Fix broken template rendering on /search requests #8757
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Work search template expects a SearchResponse object, but None was being sent if the request did not have any params. Updated request to always send a SearchResponse object.
Also, removed an unused import.
Closes #8730
Fix the broken rendering issues on the '/search' page when there are no query params.
Technical
There was existing logic to prevent the solr search query from being executed if the param dict was empty. I am assuming this was done to prevent a db hit. Executing the search query with the empty param was a solution that I tested and worked but I decided to send back an empty SearchResponse.
Testing
These are the steps I took to test.
/search
page. Search form should be rendered./advancedsearch
and submit and empty search. This will redirect to/search
and the Search form should render.ALL
filter and submit an empty search. This will redirect to/search
and the Search form should render.Screenshot
Stakeholders