From: Chad Horohoe Date: Wed, 27 Aug 2014 23:17:02 +0000 (-0700) Subject: Remove SpecialSearchNoResults and call SpecialSearchResults always X-Git-Tag: 1.31.0-rc.0~14246^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=commitdiff_plain;h=1bb93ae45ab6fefd269b1be1c1dab13077aec320;p=lhc%2Fweb%2Fwiklou.git Remove SpecialSearchNoResults and call SpecialSearchResults always 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 --- diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index 4ae33e3e8e..1205cebe15 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -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 diff --git a/docs/hooks.txt b/docs/hooks.txt index 65b1675530..ad5377efb1 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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[''] => ; ) diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 59d65bc73b..3407476494 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -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 ) {