From e880e10f145e083128b2bac26a0f77065640c0d0 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 21 Nov 2024 12:30:15 +0100 Subject: [PATCH] SearchControls: clone UrlParams instance for setEditorUrl() - Otherwise for example calling `$searchbar->getEditorUrl()->setParam('foo')` to manupulate params in *Any*Controller will affect the params of $redurectUrl --- src/Compat/SearchControls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compat/SearchControls.php b/src/Compat/SearchControls.php index 8634e107..70b4ec8e 100644 --- a/src/Compat/SearchControls.php +++ b/src/Compat/SearchControls.php @@ -93,7 +93,7 @@ public function createSearchBar(Query $query, ...$params): SearchBar if (method_exists($this, 'searchEditorAction')) { $searchBar->setEditorUrl(Url::fromPath( "$moduleName/$controllerName/search-editor" - )->setParams($redirectUrl->getParams())); + )->setParams(clone $redirectUrl->getParams())); } $filterColumns = $this->fetchFilterColumns($query);