FilterEditor: Use a new url from request when redirecting searches

Creating a new url has the benefit that all framework params are
still there. `$this->url()` however returns a url that's already
mangled and parameter preservation does not work for framework
params.

This is not quite the correct fix. But the entire parameter
handling here is way too convoluted.
This commit is contained in:
Johannes Meyer 2020-06-03 15:47:57 +02:00
parent 46c6201a21
commit 60c3fd6406
1 changed files with 4 additions and 6 deletions

View File

@ -285,12 +285,10 @@ class FilterEditor extends AbstractWidget
}
}
$url = $this->url()->setQueryString(
$filter->toQueryString()
)->addParams($preserve);
if ($modify) {
$url->getParams()->add('modifyFilter');
}
$url = Url::fromRequest()->onlyWith($this->preserveParams);
$urlParams = $url->getParams();
$url->setQueryString($filter->toQueryString());
$url->getParams()->mergeValues($urlParams->toArray(false));
$this->redirectNow($url);
}