Skip to content
Snippets Groups Projects
Commit cf6792ed authored by Demian Katz's avatar Demian Katz
Browse files

Prevent unwanted conversion to advanced search.

parent 4566ee96
No related merge requests found
...@@ -449,13 +449,18 @@ class Params implements ServiceLocatorAwareInterface ...@@ -449,13 +449,18 @@ class Params implements ServiceLocatorAwareInterface
$this->searchType = $this->query instanceof Query ? 'basic' : 'advanced'; $this->searchType = $this->query instanceof Query ? 'basic' : 'advanced';
// If we ended up with a basic search, set the default handler if necessary // If we ended up with a basic search, it's probably the result of
// and convert it to an advanced search: // submitting an empty form, and more processing may be needed:
if ($this->searchType == 'basic') { if ($this->searchType == 'basic') {
// Set a default handler if necessary:
if ($this->query->getHandler() === null) { if ($this->query->getHandler() === null) {
$this->query->setHandler($this->getOptions()->getDefaultHandler()); $this->query->setHandler($this->getOptions()->getDefaultHandler());
} }
$this->convertToAdvancedSearch(); // If the user submitted the advanced search form, we want to treat
// the search as advanced even if it evaluated to a basic search.
if ($request->offsetExists('lookfor0')) {
$this->convertToAdvancedSearch();
}
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment