Remove SpecialSearchNoResults and call SpecialSearchResults always
authorChad Horohoe <chadh@wikimedia.org>
Wed, 27 Aug 2014 23:17:02 +0000 (16:17 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Wed, 27 Aug 2014 23:19:56 +0000 (16:19 -0700)
The former hook is only used by one extension which uses the
same code path for both hooks meaning no fix is necessary. Makes
it possible for extensions to actually provide results when none
were found.

Change-Id: Ia4d56b2a1a7531529dbde8a011a33a4482c04932

RELEASE-NOTES-1.24
docs/hooks.txt
includes/specials/SpecialSearch.php

index 4ae33e3..1205ceb 100644 (file)
@@ -430,6 +430,8 @@ changes to languages because of Bugzilla reports.
   Running update.php on MySQL < v5.1 may result in heavy processing.
 * RSS and Atom feeds generated by MediaWiki no longer include a fallback
   stylesheet. It was ignored by most browsers these days anyway.
+* SpecialSearchNoResults hook has been removed. SpecialSearchResults is now
+  called unconditionally.
 
 ==== Renamed classes ====
 * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
index 65b1675..ad5377e 100644 (file)
@@ -2513,16 +2513,11 @@ $specialSearch: SpecialSearch object ($this)
 $output: $wgOut
 $term: Search term specified by the user
 
-'SpecialSearchResults': Called before search result display when there are
-matches.
+'SpecialSearchResults': Called before search result display
 $term: string of search term
 &$titleMatches: empty or SearchResultSet object
 &$textMatches: empty or SearchResultSet object
 
-'SpecialSearchNoResults': Called before search result display when there are no
-matches.
-$term: string of search term
-
 'SpecialStatsAddExtra': Add extra statistic at the end of Special:Statistics.
 &$extraStats: Array to save the new stats
   ( $extraStats['<name of statistic>'] => <value>; )
index 59d65bc..3407476 100644 (file)
@@ -367,10 +367,8 @@ class SpecialSearch extends SpecialPage {
                                        $this->limit + $this->offset >= $totalRes
                                );
                        }
-                       wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) );
-               } else {
-                       wfRunHooks( 'SpecialSearchNoResults', array( $term ) );
                }
+               wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) );
 
                $out->parserOptions()->setEditSection( false );
                if ( $titleMatches ) {