Skip to content
Extraits de code Groupes Projets
Valider 7853d2d1 rédigé par mattab's avatar mattab
Parcourir les fichiers

fixes #3892 Fixing + testing filter_truncate on getPlugin

parent 1c41d3cb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -492,6 +492,9 @@ class Piwik_DataTable_Row ...@@ -492,6 +492,9 @@ class Piwik_DataTable_Row
private function getColumnValuesMerged($operation, $thisColumnValue, $columnToSumValue) private function getColumnValuesMerged($operation, $thisColumnValue, $columnToSumValue)
{ {
switch ($operation) { switch ($operation) {
case 'skip':
$newValue = null;
break;
case 'max': case 'max':
$newValue = max($thisColumnValue, $columnToSumValue); $newValue = max($thisColumnValue, $columnToSumValue);
break; break;
......
...@@ -215,6 +215,11 @@ class Piwik_UserSettings_API ...@@ -215,6 +215,11 @@ class Piwik_UserSettings_API
$visitsSum = $visitsSumTotal - $ieVisits; $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 // The filter must be applied now so that the new column can
// be sorted by the generic filters (applied right after this loop exits) // 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)); $table->filter('ColumnCallbackAddColumnPercentage', array('nb_visits_percentage', Piwik_Archive::INDEX_NB_VISITS, $visitsSum, 1));
......
...@@ -16,6 +16,9 @@ require_once PIWIK_INCLUDE_PATH . '/libs/UserAgentParser/UserAgentParser.php'; ...@@ -16,6 +16,9 @@ require_once PIWIK_INCLUDE_PATH . '/libs/UserAgentParser/UserAgentParser.php';
function Piwik_getPluginsLogo($oldLabel) function Piwik_getPluginsLogo($oldLabel)
{ {
if($oldLabel == Piwik_Translate('General_Others')) {
return false;
}
return 'plugins/UserSettings/images/plugins/' . $oldLabel . '.gif'; return 'plugins/UserSettings/images/plugins/' . $oldLabel . '.gif';
} }
......
...@@ -24,7 +24,12 @@ class Test_Piwik_Integration_OneVisitor_LongUrlsTruncated extends IntegrationTes ...@@ -24,7 +24,12 @@ class Test_Piwik_Integration_OneVisitor_LongUrlsTruncated extends IntegrationTes
public function getApiForTesting() 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( return array(
array($apiToCall, array('idSite' => self::$fixture->idSite, array($apiToCall, array('idSite' => self::$fixture->idSite,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter