Last modified: 2013-12-04 17:50:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59961, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57961 - CirrusSearchSearcher::prefixSearch() returns a Status and breaks the PrefixSearchBackend hook caller
CirrusSearchSearcher::prefixSearch() returns a Status and breaks the PrefixSe...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CirrusSearch (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Nik Everett
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-04 05:23 UTC by Tim Starling
Modified: 2013-12-04 17:50 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Starling 2013-12-04 05:23:49 UTC
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.
Comment 1 Nik Everett 2013-12-04 13:31:08 UTC
Yeah, the bulk of Cirrus was written before you made that recommendation clear to me months ago and I haven't gotten around to retrofitting it is used in a few places but not others.  Now is as good a time as any to make it universal.

Assigning high and working on it now because I'm not in the middle of anything and I'm not a fan of losing my intentional logs to unintentional mistakes.
Comment 2 Gerrit Notification Bot 2013-12-04 16:39:53 UTC
Change 99144 had a related patch set uploaded by Manybubbles:
Switch search methods to always return status

https://gerrit.wikimedia.org/r/99144
Comment 3 Gerrit Notification Bot 2013-12-04 17:43:07 UTC
Change 99144 merged by jenkins-bot:
Switch search methods to always return status

https://gerrit.wikimedia.org/r/99144

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links