diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-11 10:24:27 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-11 10:24:27 +0300 |
commit | 983535f3d749e1b95b3a4b22305c2627902c1de7 (patch) | |
tree | 3b5287615897fa12c6dd9973f986e555777fe452 /core/Plugin/Visualization.php | |
parent | dc5d258fbecb07c0536e9f118e1efac6c0b072fa (diff) |
Fixing goals UI tests.
Diffstat (limited to 'core/Plugin/Visualization.php')
-rw-r--r-- | core/Plugin/Visualization.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php index e7e79c62e2..cb92727d55 100644 --- a/core/Plugin/Visualization.php +++ b/core/Plugin/Visualization.php @@ -9,6 +9,7 @@ namespace Piwik\Plugin; +use Piwik\API\DataTablePostProcessor; use Piwik\Common; use Piwik\DataTable; use Piwik\Date; @@ -163,7 +164,7 @@ class Visualization extends ViewDataTable $this->beforeLoadDataTable(); - $this->loadDataTableFromAPI(array('disable_generic_filters' => 1)); + $this->loadDataTableFromAPI(array('disable_generic_filters' => 1, 'disable_queued_filters' => 1)); $this->postDataTableLoadedFromAPI(); $requestPropertiesAfterLoadDataTable = $this->requestConfig->getProperties(); @@ -308,6 +309,8 @@ class Visualization extends ViewDataTable private function applyFilters() { + $postProcessor = $this->makeDataTablePostProcessor(); + list($priorityFilters, $otherFilters) = $this->config->getFiltersToRun(); // First, filters that delete rows @@ -323,9 +326,11 @@ class Visualization extends ViewDataTable } if (!$this->requestConfig->areGenericFiltersDisabled()) { - $this->applyGenericFilters(); + $this->dataTable = $postProcessor->applyGenericFilters($this->dataTable); } + $postProcessor->applyComputeProcessedMetrics($this->dataTable); + $this->afterGenericFiltersAreAppliedToLoadedDataTable(); // queue other filters so they can be applied later if queued filters are disabled @@ -567,10 +572,7 @@ class Visualization extends ViewDataTable // eg $this->config->showFooterColumns = true; } - /** - * Second, generic filters (Sort, Limit, Replace Column Names, etc.) - */ - private function applyGenericFilters() + private function makeDataTablePostProcessor() { $requestArray = $this->request->getRequestArray(); $request = \Piwik\API\Request::getRequestArrayFromString($requestArray); @@ -580,8 +582,7 @@ class Visualization extends ViewDataTable $request['filter_sort_order'] = ''; } - $genericFilter = new \Piwik\API\DataTableGenericFilter($request); - $genericFilter->filter($this->dataTable); + return new DataTablePostProcessor($this->requestConfig->getApiModuleToRequest(), $this->requestConfig->getApiMethodToRequest(), $request); } private function logMessageIfRequestPropertiesHaveChanged(array $requestPropertiesBefore) |