r78323 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78322‎ | r78323 | r78324 >
Date:20:12, 13 December 2010
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
MFT SpecialSearchGo hook: r78320, r78268, r78295, r78297, r78320
Modified paths:
  • /branches/REL1_17/phase3/docs/hooks.txt (modified) (history)
  • /branches/REL1_17/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/docs/hooks.txt
@@ -1597,13 +1597,13 @@
15981598 &$query_options: array of options for the database request
15991599 &$select: String '*' or array of columns to select
16001600
1601 -'SpecialSearchGomatch': called when user clicked the "Go" button and the target
1602 -exists
1603 -&$title: title object generated from the text entred by the user
 1601+'SpecialSearchGo': called when user clicked the "Go"
 1602+&$title: title object generated from the text entered by the user
 1603+&$term: the search term entered by the user
16041604
16051605 'SpecialSearchNogomatch': called when user clicked the "Go" button but the
16061606 target doesn't exist
1607 -&$title: title object generated from the text entred by the user
 1607+&$title: title object generated from the text entered by the user
16081608
16091609 'SpecialSearchProfiles': allows modification of search profiles
16101610 &$profiles: profiles, which can be modified.
Property changes on: branches/REL1_17/phase3/docs/hooks.txt
___________________________________________________________________
Added: svn:mergeinfo
16111611 Merged /branches/new-installer/phase3/docs/hooks.txt:r43664-66004
16121612 Merged /branches/REL1_15/phase3/docs/hooks.txt:r51646
16131613 Merged /branches/sqlite/docs/hooks.txt:r58211-58321
16141614 Merged /trunk/phase3/docs/hooks.txt:r78262-78320
Index: branches/REL1_17/phase3/includes/specials/SpecialSearch.php
@@ -91,8 +91,13 @@
9292 }
9393 # If there's an exact or very near match, jump right there.
9494 $t = SearchEngine::getNearMatch( $term );
 95+
 96+ if ( !wfRunHooks( 'SpecialSearchGo', array( &$t, &$term ) ) ) {
 97+ # Hook requested termination
 98+ return;
 99+ }
 100+
95101 if( !is_null( $t ) ) {
96 - wfRunHooks( 'SpecialSearchGomatch', array( &$t ) );
97102 $wgOut->redirect( $t->getFullURL() );
98103 return;
99104 }
Property changes on: branches/REL1_17/phase3/includes/specials/SpecialSearch.php
___________________________________________________________________
Added: svn:mergeinfo
100105 Merged /branches/wmf-deployment/includes/specials/SpecialSearch.php:r53381,56967
101106 Merged /branches/REL1_15/phase3/includes/specials/SpecialSearch.php:r51646
102107 Merged /branches/sqlite/includes/specials/SpecialSearch.php:r58211-58321
103108 Merged /trunk/phase3/includes/specials/SpecialSearch.php:r78262-78320

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78268Followup r65114 (per CR cabal), remove SpecialSearchGomatch, replace with Spe...reedy18:57, 12 December 2010
r78295Followup r78268, do it as Bryan suggested, not as how I'd interpretted it for...reedy11:06, 13 December 2010
r78297Followup r78295, seems I didn't even bother to rename it last timereedy12:38, 13 December 2010
r78320Follow-up r78297: allow the hook to break the execution; added &$term: could ...btongminh20:00, 13 December 2010

Comments

#Comment by Catrope (talk | contribs)   20:49, 29 December 2010

You merged r78320 twice? :P

#Comment by Bryan (talk | contribs)   20:52, 29 December 2010

Yeah I thought it to be twice as important :p

Status & tagging log