Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2019-12-24 16:15:26 +0300
committerGitHub <noreply@github.com>2019-12-24 16:15:26 +0300
commitdedaf6b3e9a184937539e181c64b80c1db04a0c7 (patch)
tree13f8427ef73198714f9de7f995354c7357f3a890 /plugins/VisitFrequency
parent42454eb56e02899d2282e1eb6bf81983e666d933 (diff)
MergeDataTables does not correctly merge if table2 has more data than table1 (#15294)
* update submodules to fix build * Handle DataTable Maps in VisitFrequency API and in DataTable merger, make sure to correctly copy child datatables. * fix some tests * Copy metadata over. * Updated expected test results. * Adding unit tests.
Diffstat (limited to 'plugins/VisitFrequency')
-rw-r--r--plugins/VisitFrequency/API.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/VisitFrequency/API.php b/plugins/VisitFrequency/API.php
index f44d624402..854b0de5f5 100644
--- a/plugins/VisitFrequency/API.php
+++ b/plugins/VisitFrequency/API.php
@@ -9,8 +9,8 @@
namespace Piwik\Plugins\VisitFrequency;
use Piwik\API\Request;
-use Piwik\Archive;
use Piwik\DataTable;
+use Piwik\Period;
use Piwik\Piwik;
use Piwik\Plugins\API\DataTable\MergeDataTables;
use Piwik\Plugins\VisitsSummary\API as APIVisitsSummary;
@@ -49,7 +49,12 @@ class API extends \Piwik\Plugin\API
$columns = Piwik::getArrayFromApiParameter($columns);
/** @var \Piwik\DataTable\DataTableInterface $resultSet */
- $resultSet = new DataTable\Simple();
+ if (Period::isMultiplePeriod($date, $period)) {
+ $resultSet = new DataTable\Map();
+ $resultSet->setKeyName('period');
+ } else {
+ $resultSet = new DataTable\Simple();
+ }
foreach ($visitTypes as $columnSuffix => $visitorTypeSegment) {
$modifiedSegment = $this->appendVisitorTypeSegment($segment, $visitorTypeSegment);