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: wikibugs-l@lists.wikimedia.org
          Reporter: tstarl...@wikimedia.org
                CC: dga...@wikimedia.org, innocentkil...@gmail.com,
                    neverett+bugzi...@wikimedia.org
    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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to