Skip to content

Commit

Permalink
refs #4007 this should have been in 84fb1bf
Browse files Browse the repository at this point in the history
 * don't override columns parameter when it is set from the dashboard widget "Visits Overview (with graph)"
 * remove columns parameter when requesting VisitsSummary.get

---

what i did commit in 84fb1bf was the first step towards making piwik work again in ie8. sorry for the mix up.
  • Loading branch information
timo-bes committed Jun 17, 2013
1 parent 9d9ddea commit 3174917
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions plugins/VisitsSummary/Controller.php
Expand Up @@ -19,7 +19,15 @@ public function index()
{
$view = Piwik_View::factory('index');
$this->setPeriodVariablesView($view);
$view->graphEvolutionVisitsSummary = $this->getEvolutionGraph(true, array('nb_visits'));

// if the columns parameter parameter is set, we need to pass an empty array
// to getEvolutionGraph() because otherwise we would override it and restoring
// the selected metrics on the dashboard wouldn't work.
$columnsParameter = Piwik_Common::getRequestVar('columns', false);
$columnsParameterIsSet = !empty($columnsParameter);
$columns = $columnsParameterIsSet ? array() : array('nb_visits');
$view->graphEvolutionVisitsSummary = $this->getEvolutionGraph(true, $columns);

$this->setSparklinesAndNumbers($view);
echo $view->render();
}
Expand Down Expand Up @@ -92,7 +100,10 @@ static public function getVisitsSummary()
"&format=original" .
// we disable filters for example "search for pattern", in the case this method is called
// by a method that already calls the API with some generic filters applied
"&disable_generic_filters=1";
"&disable_generic_filters=1" .
// override the columns parameter that might be there in the $_GET array because a non-empty
// value would cause an error
"&columns=";
$request = new Piwik_API_Request($requestString);
$result = $request->process();
return empty($result) ? new Piwik_DataTable() : $result;
Expand Down

0 comments on commit 3174917

Please sign in to comment.