diff --git a/src/Common/StateBadges.php b/src/Common/StateBadges.php index 15f28997..e6e9cfda 100644 --- a/src/Common/StateBadges.php +++ b/src/Common/StateBadges.php @@ -125,9 +125,7 @@ public function createLink($content, array $filter = null): Link } if (! $urlFilter->isEmpty()) { - $urlParams = $url->getParams()->toArray(false); - $url->setQueryString(QueryString::render($urlFilter)) - ->addParams($urlParams); + $url->setFilter($urlFilter); } return new Link($content, $url); diff --git a/src/Compat/SearchControls.php b/src/Compat/SearchControls.php index 4832b0af..f6e74aba 100644 --- a/src/Compat/SearchControls.php +++ b/src/Compat/SearchControls.php @@ -127,17 +127,7 @@ public function createSearchBar(Query $query, ...$params): SearchBar ->on(SearchBar::ON_SENT, function (SearchBar $form) { /** @var Url $redirectUrl */ $redirectUrl = $form->getRedirectUrl(); - $existingParams = $redirectUrl->getParams(); - $redirectUrl->setQueryString(QueryString::render($form->getFilter())); - foreach ($existingParams->toArray(false) as $name => $value) { - if (is_int($name)) { - $name = $value; - $value = true; - } - - $redirectUrl->getParams()->addEncoded($name, $value); - } - + $redirectUrl->setFilter($form->getFilter()); $form->setRedirectUrl($redirectUrl); })->on(SearchBar::ON_SUCCESS, function (SearchBar $form) { $this->getResponse()->redirectAndExit($form->getRedirectUrl()); @@ -227,16 +217,7 @@ public function createSearchEditor(Query $query, ...$params): SearchEditor })->on(SearchEditor::ON_SUCCESS, function (SearchEditor $form) { /** @var Url $redirectUrl */ $redirectUrl = $form->getRedirectUrl(); - $existingParams = $redirectUrl->getParams(); - $redirectUrl->setQueryString(QueryString::render($form->getFilter())); - foreach ($existingParams->toArray(false) as $name => $value) { - if (is_int($name)) { - $name = $value; - $value = true; - } - - $redirectUrl->getParams()->addEncoded($name, $value); - } + $redirectUrl->setFilter($form->getFilter()); $this->getResponse() ->setHeader('X-Icinga-Container', '_self') diff --git a/src/Widget/ContinueWith.php b/src/Widget/ContinueWith.php index 4aaf52eb..1479e9af 100644 --- a/src/Widget/ContinueWith.php +++ b/src/Widget/ContinueWith.php @@ -63,7 +63,7 @@ public function assemble() } else { $this->addHtml(new ActionLink( null, - $this->url->setQueryString(QueryString::render($filter)), + $this->url->setFilter($filter), 'share', ['class' => 'control-button', 'title' => $this->title] ));