From 09a859a1a0165697084d42c07efaa1206d5285ce Mon Sep 17 00:00:00 2001 From: Thomas Steur <thomas.steur@gmail.com> Date: Mon, 21 Oct 2013 03:43:04 +0000 Subject: [PATCH] always disable generic filters as we apply them later in the visualization --- core/Plugin/Visualization.php | 2 +- core/ViewDataTable/Request.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php index bc09cdeeea..c953f64145 100644 --- a/core/Plugin/Visualization.php +++ b/core/Plugin/Visualization.php @@ -61,7 +61,7 @@ class Visualization extends ViewDataTable $this->beforeLoadDataTable(); - $this->loadDataTableFromAPI(); + $this->loadDataTableFromAPI(array('disable_generic_filters' => 1)); $this->postDataTableLoadedFromAPI(); $requestPropertiesAfterLoadDataTable = $this->requestConfig->getProperties(); diff --git a/core/ViewDataTable/Request.php b/core/ViewDataTable/Request.php index 80eb46aed4..e304758f29 100644 --- a/core/ViewDataTable/Request.php +++ b/core/ViewDataTable/Request.php @@ -38,11 +38,15 @@ class Request * It builds the API request string and uses Request to call the API. * The requested DataTable object is stored in $this->dataTable. */ - public function loadDataTableFromAPI() + public function loadDataTableFromAPI($fixedRequestParams = array()) { // we build the request (URL) to call the API $requestArray = $this->getRequestArray(); + foreach ($fixedRequestParams as $key => $value) { + $requestArray[$key] = $value; + } + // we make the request to the API $request = new ApiRequest($requestArray); @@ -62,9 +66,8 @@ class Request // - we request the method to call to get this specific DataTable // - the format = original specifies that we want to get the original DataTable structure itself, not rendered $requestArray = array( - 'method' => $this->requestConfig->apiMethodToRequestDataTable, - 'format' => 'original', - 'disable_generic_filters' => Common::getRequestVar('disable_generic_filters', 1, 'int') + 'method' => $this->requestConfig->apiMethodToRequestDataTable, + 'format' => 'original' ); $toSetEventually = array( -- GitLab