Skip to content

Commit

Permalink
bug #2444 Maintain the selected menu when making an empty search (jav…
Browse files Browse the repository at this point in the history
…iereguiluz)

This PR was merged into the 1.x branch.

Discussion
----------

Maintain the selected menu when making an empty search

This fixes #2396.

Kudos to @l396635210 who found the problem, reproduced it and provided the solution.

Commits
-------

0889934 Maintain the selected menu when making an empty search
  • Loading branch information
javiereguiluz committed Nov 28, 2018
2 parents 789fe1b + 0889934 commit 8cc2d0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ protected function searchAction()
$query = trim($this->request->query->get('query'));
// if the search query is empty, redirect to the 'list' action
if ('' === $query) {
$queryParameters = array_replace($this->request->query->all(), array('action' => 'list', 'query' => null));
$queryParameters = array_filter($queryParameters);
$queryParameters = array_replace($this->request->query->all(), array('action' => 'list'));
unset($queryParameters['query']);

return $this->redirect($this->get('router')->generate('easyadmin', $queryParameters));
}
Expand Down

0 comments on commit 8cc2d0e

Please sign in to comment.