From 8bc18861652ddcd64f8022318f0b8201ac7e9ba4 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Tue, 6 Aug 2019 14:16:13 -0700 Subject: Handle ranking query others row properly in contents & events archiver. (#14622) * Add more types of actions to ManyVisitsWithMockLocationProvider fixture. * fix test change * update expected test files * Handle ranking query others row properly in contents & events archiver. * Use custom ranking query specific others label and handle by default in DataArray::asDatatable(). * Updating expected test files. * Use strict compare since label can be 0 apparently. * Update expecred test files. --- plugins/Actions/ArchivingHelper.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/Actions/ArchivingHelper.php') diff --git a/plugins/Actions/ArchivingHelper.php b/plugins/Actions/ArchivingHelper.php index 2e878a45bb..e5c315d0b1 100644 --- a/plugins/Actions/ArchivingHelper.php +++ b/plugins/Actions/ArchivingHelper.php @@ -15,6 +15,7 @@ use Piwik\DataTable; use Piwik\DataTable\Row; use Piwik\Metrics as PiwikMetrics; use Piwik\Piwik; +use Piwik\RankingQuery; use Piwik\Tracker\Action; use Piwik\Tracker\PageUrl; use Zend_Db_Statement; @@ -57,7 +58,7 @@ class ArchivingHelper continue; } - $hasRowName = !empty($row['name']) && $row['name'] != DataTable::LABEL_SUMMARY_ROW; + $hasRowName = !empty($row['name']) && $row['name'] != RankingQuery::LABEL_SUMMARY_ROW; // This will appear as in the API, which is actually very important to keep // eg. When there's at least one row in a report that does not have a URL, not having this would break HTML/PDF reports. @@ -381,7 +382,7 @@ class ArchivingHelper } // check for ranking query cut-off - if ($actionName == DataTable::LABEL_SUMMARY_ROW) { + if ($actionName == RankingQuery::LABEL_SUMMARY_ROW) { $summaryRow = $currentTable->getRowFromId(DataTable::ID_SUMMARY_ROW); if ($summaryRow === false) { $summaryRow = $currentTable->addSummaryRow(self::createSummaryRow()); @@ -499,7 +500,7 @@ class ArchivingHelper */ private static function getCachedActionRowKey($idAction, $actionType) { - return $idAction == DataTable::LABEL_SUMMARY_ROW + return $idAction == RankingQuery::LABEL_SUMMARY_ROW ? $actionType . '_others' : $idAction; } -- cgit v1.2.3