From 98c2e9f7bf39617886ba2562874c6dfa0d2e9124 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 28 May 2020 16:10:52 +0200 Subject: [PATCH] Controller: Already shift filter params in `createFilterControl()` --- library/Icingadb/Web/Controller.php | 7 +++++++ library/Icingadb/Widget/FilterControl.php | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php index fc39e48a..b559da76 100644 --- a/library/Icingadb/Web/Controller.php +++ b/library/Icingadb/Web/Controller.php @@ -146,6 +146,13 @@ class Controller extends CompatController $filterControl = new FilterControl($query, $preserveParams); $filterControl->handleRequest($request); + // We're cloning the params, the editor does it, so we have to shift these ourselves + $this->params->shift('addFilter'); + $this->params->shift('removeFilter'); + $this->params->shift('stripFilter'); + $this->params->shift('modifyFilter'); + $this->params->shift('q'); + return $filterControl; } diff --git a/library/Icingadb/Widget/FilterControl.php b/library/Icingadb/Widget/FilterControl.php index bba6b955..6af59b43 100644 --- a/library/Icingadb/Widget/FilterControl.php +++ b/library/Icingadb/Widget/FilterControl.php @@ -38,14 +38,6 @@ class FilterControl extends HtmlDocument public function handleRequest(Request $request) { $this->getFilterEditor()->handleRequest($request); - - // The editor clones the url prior shifting these so we have to do it again here - $params = $request->getUrl()->getParams(); - $params->shift('addFilter'); - $params->shift('removeFilter'); - $params->shift('stripFilter'); - $params->shift('modifyFilter'); - $params->shift('q'); } /**