Stop Special:Search failing when no Elasticsearch query was run - #288
Draft
JeroenDeDauw wants to merge 1 commit into
Draft
JeroenDeDauw wants to merge 1 commit into
JeroenDeDauw wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #288 +/- ##
============================================
+ Coverage 75.51% 77.15% +1.63%
- Complexity 429 430 +1
============================================
Files 50 50
Lines 1401 1405 +4
============================================
+ Hits 1058 1084 +26
+ Misses 343 321 -22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JeroenDeDauw
force-pushed
the
fix/empty-search-result-set
branch
from
September 8, 2026 23:28
2344255 to
1ffb57a
Compare
CirrusSearch answers with an `EmptySearchResultSet` whenever it decides up front that nothing can match — for instance `incategory:id:` with a page id that does not exist, an unknown `deepcat:` category, or a malformed regex. That result set carries no Elastica result set, which the `SpecialSearchResults` handler dereferenced unconditionally, so any such search on a configured wiki produced "Call to a member function getQuery() on null" instead of a results page. The handler now records the current query only when there is one; the append handler already renders no sidebar in that case. Tests cover both kinds of result set. Considered, omitted: rendering the facets with empty counts as `action=wbfacetsearch` does, by reusing its builder in the sidebar. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
JeroenDeDauw
force-pushed
the
fix/empty-search-result-set
branch
from
September 8, 2026 23:33
1ffb57a to
33275af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CirrusSearch answers with an
EmptySearchResultSetwhenever it decides up front that nothing can match — forinstance
incategory:id:with a page id that does not exist, an unknowndeepcat:category, or a malformedregex. That result set carries no Elastica result set, which the
SpecialSearchResultshandler dereferencedunconditionally, so any such search on a configured wiki produced "Call to a member function getQuery() on null"
instead of a results page. The handler now records the current query only when there is one; the append handler
already renders no sidebar in that case. Tests cover both kinds of result set.
Considered, omitted: rendering the facets with empty counts as
action=wbfacetsearchdoes, by reusing its builderin the sidebar.