Skip to content
Extraits de code Groupes Projets
Valider befb48d8 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Fixes #3898, fix error that occurs when multi row evolution is called w/o...

Fixes #3898, fix error that occurs when multi row evolution is called w/o labels for periods w/ no data.
parent c91a6034
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -1197,7 +1197,7 @@ class Piwik_API_API
}
}
if (count($labels) > 1) {
if (count($labels) != 1) {
$data = $this->getMultiRowEvolution(
$dataTable,
$idSite,
......@@ -1538,7 +1538,10 @@ class Piwik_API_API
}
$newTable = $table->getEmptyClone();
$newTable->addRow($newRow);
if (!empty($labels)) { // only add a row if the row has data (no labels === no data)
$newTable->addRow($newRow);
}
$dataTableMulti->addTable($newTable, $tableLabel);
}
......
......@@ -171,6 +171,21 @@ class Test_Piwik_Integration_RowEvolution extends IntegrationTestCase
)
));
// test multi row evolution when there is no data
$return[] = array('API.getRowEvolution', array(
'testSuffix' => '_multiWithNoData',
'periods' => 'day',
'idSite' => $idSite,
'date' => $today,
'otherRequestParameters' => array(
'date' => '2010-04-01,2010-04-06',
'period' => 'day',
'apiModule' => 'Referers',
'apiAction' => 'getWebsites',
// no label
)
));
// (non-rowevolution test) test flattener w/ search engines to make sure
// queued filters are not applied twice
$return[] = array('Referers.getSearchEngines', array(
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter