From f28b3c65756f2a9cbe409b4a633e3019e7dfcb43 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 14 Oct 2020 16:35:11 +0200 Subject: [PATCH] Controller: Allow to pass a filter to method `filter()` It's not always the request's filter that should be used. --- library/Icingadb/Web/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php index 297f6e66..224cb8db 100644 --- a/library/Icingadb/Web/Controller.php +++ b/library/Icingadb/Web/Controller.php @@ -317,12 +317,12 @@ class Controller extends CompatController return parent::addContent($content); } - public function filter(Query $query) + public function filter(Query $query, Filter $filter = null) { $this->applyMonitoringRestriction($query); FilterProcessor::apply( - $this->getFilter(), + $filter ?: $this->getFilter(), $query );