Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/API
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2019-01-28 02:50:30 +0300
committerGitHub <noreply@github.com>2019-01-28 02:50:30 +0300
commit0f5b2314eaa6786fab0c4ac653beead69e6dcad8 (patch)
treef3ec22d16f1556ec3cbc793d60449816c46b522a /core/API
parentc4caca4f140d9a7e58d30499adf40b78ed22bdd7 (diff)
Allow DataTables to disable generic filters gthrough a datatable metadata. (#14004)
* Allow DataTables to disable generic filters gthrough a datatable metadata. * Add unit test for metadata.
Diffstat (limited to 'core/API')
-rw-r--r--core/API/DataTableGenericFilter.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/API/DataTableGenericFilter.php b/core/API/DataTableGenericFilter.php
index adc059ae07..d543abc437 100644
--- a/core/API/DataTableGenericFilter.php
+++ b/core/API/DataTableGenericFilter.php
@@ -155,6 +155,7 @@ class DataTableGenericFilter
return;
}
+ $tableDisabledFilters = $datatable->getMetadata(DataTable::GENERIC_FILTERS_TO_DISABLE_METADATA_NAME) ?: [];
$genericFilters = $this->getGenericFiltersHavingDefaultValues();
$filterApplied = false;
@@ -164,7 +165,9 @@ class DataTableGenericFilter
$filterParameters = array();
$exceptionRaised = false;
- if (in_array($filterName, $this->disabledFilters)) {
+ if (in_array($filterName, $this->disabledFilters)
+ || in_array($filterName, $tableDisabledFilters)
+ ) {
continue;
}