r78268 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78267‎ | r78268 | r78269 >
Date:18:57, 12 December 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Followup r65114 (per CR cabal), remove SpecialSearchGomatch, replace with SpecialSearchGo in SearchEngine::getNearMatch
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/search/SearchEngine.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1607,8 +1607,7 @@
16081608 &$query_options: array of options for the database request
16091609 &$select: String '*' or array of columns to select
16101610
1611 -'SpecialSearchGomatch': called when user clicked the "Go" button and the target
1612 -exists
 1611+'SpecialSearchGo': called when user clicked the "Go"
16131612 &$title: title object generated from the text entered by the user
16141613
16151614 'SpecialSearchNogomatch': called when user clicked the "Go" button but the
Index: trunk/phase3/includes/search/SearchEngine.php
@@ -92,6 +92,8 @@
9393 public static function getNearMatch( $searchterm ) {
9494 $title = self::getNearMatchInternal( $searchterm );
9595
 96+ wfRunHooks( 'SpecialSearchGomatch', array( &$title ) );
 97+
9698 wfRunHooks( 'SearchGetNearMatchComplete', array( $searchterm, &$title ) );
9799 return $title;
98100 }
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -103,7 +103,6 @@
104104 # If there's an exact or very near match, jump right there.
105105 $t = SearchEngine::getNearMatch( $term );
106106 if( !is_null( $t ) ) {
107 - wfRunHooks( 'SpecialSearchGomatch', array( &$t ) );
108107 $wgOut->redirect( $t->getFullURL() );
109108 return;
110109 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r78295Followup r78268, do it as Bryan suggested, not as how I'd interpretted it for...reedy11:06, 13 December 2010
r78323MFT SpecialSearchGo hook: r78320, r78268, r78295, r78297, r78320btongminh20:12, 13 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65114Fix hooks.txt SpecialSearchNogomatch $title to &$title...reedy10:19, 16 April 2010

Comments

#Comment by Bryan (talk | contribs)   10:03, 13 December 2010

Ehh, was that a different cabal than the one that I'm part of? I believe the cabal decided that the hook should be in SpecialSearch, but just below the SearchEngine::getNearMatch() call. Perhaps you misunderstood my comment on r65114?

#Comment by Reedy (talk | contribs)   10:34, 13 December 2010

I read "below" as "in", for some reason. No idea why. Damn my brain at the moment.

Will move.

Status & tagging log