https://bugzilla.wikimedia.org/show_bug.cgi?id=57961
Web browser: ---
Bug ID: 57961
Summary: CirrusSearchSearcher::prefixSearch() returns a Status
and breaks the PrefixSearchBackend hook caller
Product: MediaWiki extensions
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: CirrusSearch
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
Mobile Platform: ---
CirrusSearchSearcher::prefixSearch() with CirrusSearchTitleResultsType can
return either a SearchResultSet subclass or a Status object.
CirrusSearch::prefixSearch() puts this Status object directly into the
&$results variable of the PrefixSearchBackend hook, without any validation,
which is presumably the cause of the PHP warnings noted by Sam Reed at
Id773c23747c.
The recommended pattern for using Status objects is to return a Status
unconditionally, with Status::newGood($value) used to indicate success. This
forces the caller to implement error handling, and thus avoids PHP errors of
this kind.
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l