diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php index ff5b5de25bbaa996aa32b78f90780e91154b8491..ed98c602e8139f35c63edc8190e66f79678a895e 100644 --- a/core/DataTable/Row.php +++ b/core/DataTable/Row.php @@ -492,6 +492,9 @@ class Piwik_DataTable_Row private function getColumnValuesMerged($operation, $thisColumnValue, $columnToSumValue) { switch ($operation) { + case 'skip': + $newValue = null; + break; case 'max': $newValue = max($thisColumnValue, $columnToSumValue); break; diff --git a/plugins/UserSettings/API.php b/plugins/UserSettings/API.php index 49a6c4d883fcd4a2817c7ed6e0234a263ab76123..e438b96b2f5724d5ac0a4cb59d8fdcc8533a895d 100644 --- a/plugins/UserSettings/API.php +++ b/plugins/UserSettings/API.php @@ -215,6 +215,11 @@ class Piwik_UserSettings_API $visitsSum = $visitsSumTotal - $ieVisits; + + // When Truncate filter is applied, it will call AddSummaryRow which tries to sum all rows. + // We tell the object to skip the column nb_visits_percentage when aggregating (since it's not correct to sum % values) + $table->setColumnAggregationOperation('nb_visits_percentage', 'skip'); + // The filter must be applied now so that the new column can // be sorted by the generic filters (applied right after this loop exits) $table->filter('ColumnCallbackAddColumnPercentage', array('nb_visits_percentage', Piwik_Archive::INDEX_NB_VISITS, $visitsSum, 1)); diff --git a/plugins/UserSettings/functions.php b/plugins/UserSettings/functions.php index 6e5db0542802d13bb6d78d78b7d1d2afc4dedad8..e1c5579608528542ebdccf6534b325161dfcae21 100644 --- a/plugins/UserSettings/functions.php +++ b/plugins/UserSettings/functions.php @@ -16,6 +16,9 @@ require_once PIWIK_INCLUDE_PATH . '/libs/UserAgentParser/UserAgentParser.php'; function Piwik_getPluginsLogo($oldLabel) { + if($oldLabel == Piwik_Translate('General_Others')) { + return false; + } return 'plugins/UserSettings/images/plugins/' . $oldLabel . '.gif'; } diff --git a/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php b/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php index 4d18196094a56d323ceee945fc060e30a981103f..02156d7a54d60c20903e8372621631dc296045b5 100644 --- a/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php +++ b/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php @@ -24,7 +24,12 @@ class Test_Piwik_Integration_OneVisitor_LongUrlsTruncated extends IntegrationTes public function getApiForTesting() { - $apiToCall = array('Referers.getKeywords', 'Actions.getPageUrls'); + $apiToCall = array( + 'Referers.getKeywords', + 'Actions.getPageUrls', + + // Specifically testing getPlugin filter_truncate works + 'UserSettings.getPlugin'); return array( array($apiToCall, array('idSite' => self::$fixture->idSite,