diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index cde0619e7542a1c4a5713a419c31952d169e38d3..dd09f57a0ea634f7857f2e56d5a043baa6a9e085 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -449,13 +449,18 @@ class Params implements ServiceLocatorAwareInterface $this->searchType = $this->query instanceof Query ? 'basic' : 'advanced'; - // If we ended up with a basic search, set the default handler if necessary - // and convert it to an advanced search: + // If we ended up with a basic search, it's probably the result of + // submitting an empty form, and more processing may be needed: if ($this->searchType == 'basic') { + // Set a default handler if necessary: if ($this->query->getHandler() === null) { $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(); + } } }