Skip to content

Commit

Permalink
refs #5253 this might fix the database usage error. It definitely fix…
Browse files Browse the repository at this point in the history
…es nothing is displayed once you change a column in the graph charts since it does not support them. The summary configuration was never applied due to a typo.
  • Loading branch information
tsteur committed May 28, 2014
1 parent 4c78ba8 commit cd2ec82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions core/ViewDataTable/Manager.php
Expand Up @@ -303,10 +303,14 @@ public static function saveViewDataTableParameters($login, $controllerAction, $p

foreach ($parametersToOverride as $key => $value) {
if ($key === 'viewDataTable'
&& !empty($params['columns'])
&& !empty($params[$key])
&& $params[$key] !== $value) {
unset($params['columns']);
if (!empty($params['columns'])) {
unset($params['columns']);
}
if (!empty($params['columns_to_display'])) {
unset($params['columns_to_display']);
}
}

$params[$key] = $value;
Expand Down
7 changes: 6 additions & 1 deletion plugins/DBStats/DBStats.php
Expand Up @@ -95,7 +95,7 @@ public function getDefaultTypeViewDataTable(&$defaultViewTypes)
public function configureViewDataTable(ViewDataTable $view)
{
switch ($view->requestConfig->apiMethodToRequestDataTable) {
case 'DBStats.getDatabaseUsageSummar':
case 'DBStats.getDatabaseUsageSummary':
$this->configureViewForGetDatabaseUsageSummary($view);
break;
case 'DBStats.getTrackerDataSummary':
Expand Down Expand Up @@ -266,6 +266,10 @@ private function addBaseDisplayProperties(ViewDataTable $view)
$view->config->highlight_summary_row = true;
}

if ($view->isViewDataTableId(Graph::ID)) {
$view->config->show_series_picker = false;
}

$view->config->addTranslations(array(
'label' => Piwik::translate('DBStats_Table'),
'year' => Piwik::translate('CoreHome_PeriodYear'),
Expand Down Expand Up @@ -334,6 +338,7 @@ private function addPresentationFilters(ViewDataTable $view, $addTotalSizeColumn
$view->requestConfig->filter_sort_column = 'row_count';
$view->requestConfig->filter_sort_order = 'desc';
}
$view->config->selectable_rows = array();
}

$getPrettySize = array('\Piwik\MetricsFormatter', 'getPrettySizeFromBytes');
Expand Down

1 comment on commit cd2ec82

@mattab
Copy link
Member

@mattab mattab commented on cd2ec82 Jun 7, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find here!

Please sign in to comment.