Unbreak extensions using SpecialSearchResults hook
authorChad Horohoe <chadh@wikimedia.org>
Wed, 18 Jan 2017 22:21:36 +0000 (14:21 -0800)
committerChad Horohoe <chadh@wikimedia.org>
Wed, 18 Jan 2017 22:22:42 +0000 (14:22 -0800)
Changing hook signatures with no deprecation period is a no-no.

Fixes Ib527fc3a3c39eb2e56985e5d1e4905fc4562353c
Reverts I153a7d590faceb1e2c4fe7d95a5cb931cda0c301

Bug: T155625
Change-Id: I2b408691fc4435ef24fc62360bd7ad6114f385c7

docs/hooks.txt
includes/specials/SpecialSearch.php

index 4057cce..ef47218 100644 (file)
@@ -3148,8 +3148,8 @@ $opts: Array: key => value of hidden options for inclusion in custom forms
 
 'SpecialSearchResults': Called before search result display
 $term: string of search term
-$titleMatches: empty or SearchResultSet object
-$textMatches: empty or SearchResultSet object
+&$titleMatches: empty or SearchResultSet object
+&$textMatches: empty or SearchResultSet object
 
 'SpecialSearchResultsPrepend': Called immediately before returning HTML
 on the search results page.  Useful for including an external search
index 9356a3a..34620ff 100644 (file)
@@ -371,7 +371,7 @@ class SpecialSearch extends SpecialPage {
                // Show the create link ahead
                $this->showCreateLink( $title, $num, $titleMatches, $textMatches );
 
-               Hooks::run( 'SpecialSearchResults', [ $term, $titleMatches, $textMatches ] );
+               Hooks::run( 'SpecialSearchResults', [ $term, &$titleMatches, &$textMatches ] );
 
                // If we have no results and have not already displayed an error message
                if ( $num === 0 && !$hasErrors ) {