diff --git a/src/Compat/SearchControls.php b/src/Compat/SearchControls.php index 384dfb66..8634e107 100644 --- a/src/Compat/SearchControls.php +++ b/src/Compat/SearchControls.php @@ -59,10 +59,10 @@ public function createSearchBar(Query $query, ...$params): SearchBar $redirectUrl = array_pop($params); $requestUrlClone = $requestUrl->onlyWith($preserveParams); - $paramsToAdd = $requestUrlClone->getParams(); + $paramsToAdd = $requestUrlClone->getParams()->toArray(false); if ($redirectUrl !== null) { - $redirectUrl->addParams($paramsToAdd->toArray(false)); + $redirectUrl->addParams($paramsToAdd); } else { $redirectUrl = $requestUrlClone; } @@ -86,10 +86,7 @@ public function createSearchBar(Query $query, ...$params): SearchBar if (method_exists($this, 'completeAction')) { $searchBar->setSuggestionUrl(Url::fromPath( "$moduleName/$controllerName/complete", - $paramsToAdd - ->set('_disableLayout', true) - ->set('showCompact', true) - ->toArray(false) + $paramsToAdd + ['_disableLayout' => true, 'showCompact' => true] )); } @@ -162,10 +159,10 @@ public function createSearchEditor(Query $query, ...$params): SearchEditor $redirectUrl = array_pop($params); $moduleName = $this->getRequest()->getModuleName(); $controllerName = $this->getRequest()->getControllerName(); - $paramsToAdd = $requestUrl->onlyWith($preserveParams)->getParams(); + $paramsToAdd = $requestUrl->onlyWith($preserveParams)->getParams()->toArray(false); if ($redirectUrl !== null) { - $redirectUrl->addParams($paramsToAdd->toArray(false)); + $redirectUrl->addParams($paramsToAdd); } else { $redirectUrl = Url::fromPath("$moduleName/$controllerName") ->setParams($paramsToAdd); @@ -179,10 +176,7 @@ public function createSearchEditor(Query $query, ...$params): SearchEditor if (method_exists($this, 'completeAction')) { $editor->setSuggestionUrl(Url::fromPath( "$moduleName/$controllerName/complete", - $paramsToAdd - ->set('_disableLayout', true) - ->set('showCompact', true) - ->toArray(false) + $paramsToAdd + ['_disableLayout' => true, 'showCompact' => true] )); }