Chad has uploaded a new change for review.

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

Change subject: Remove SpecialSearchNoResults, call SpecialSearchResults 
unconditionally
......................................................................

Remove SpecialSearchNoResults, call SpecialSearchResults unconditionally

The only user of the former hook is unaffected (same code path) and
by doing it this way it allows the no-results scenario the chance to
actually provide results.

Change-Id: I2b6b6ace6416ddb380640cec526c457498dc00be
---
M RELEASE-NOTES-1.24
M docs/hooks.txt
M includes/specials/SpecialSearch.php
3 files changed, 6 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/141069/1

diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24
index e70af75..816481d 100644
--- a/RELEASE-NOTES-1.24
+++ b/RELEASE-NOTES-1.24
@@ -169,6 +169,8 @@
 * Removed WebRequest::escapeAppendQuery(). (deprecated since 1.20)
 * SearchEngineReplacePrefixesComplete hook was removed.
 * SearchGetNearMatchBefore hook was removed.
+* SpecialSearchNoResults hook was removed, SpecialSearchResults is now called
+  regardless of whether there are results
 
 ==== Renamed classes ====
 * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 630a779..f2799cd 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -2497,15 +2497,10 @@
 $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
+&$titleMatches: empty or SearchResultSet object, will be null with no matches
+&$textMatches: empty or SearchResultSet object, will be null with no matches
 
 'SpecialStatsAddExtra': Add extra statistic at the end of Special:Statistics.
 &$extraStats: Array to save the new stats
diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 15b93ae..49e4e3c 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -369,10 +369,8 @@
                                        max( $titleMatchesNum, $textMatchesNum 
) <= $this->limit
                                );
                        }
-                       wfRunHooks( 'SpecialSearchResults', array( $term, 
&$titleMatches, &$textMatches ) );
-               } else {
-                       wfRunHooks( 'SpecialSearchNoResults', array( $term ) );
                }
+               wfRunHooks( 'SpecialSearchResults', array( $term, 
&$titleMatches, &$textMatches ) );
 
                $out->parserOptions()->setEditSection( false );
                if ( $titleMatches ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/141069
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b6b6ace6416ddb380640cec526c457498dc00be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to