r76485 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76484‎ | r76485 | r76486 >
Date:23:13, 10 November 2010
Author:demon
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.16wmf4 (modified) (history)
  • /branches/wmf/1.16wmf4/docs/hooks.txt (modified) (history)
  • /branches/wmf/1.16wmf4/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/specials/SpecialRecentchangeslinked.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/docs/hooks.txt
@@ -1486,12 +1486,13 @@
14871487 $opts: FormOptions for this request
14881488
14891489 'SpecialRecentChangesQuery': called when building sql query for
1490 -SpecialRecentChanges
 1490+SpecialRecentChanges and SpecialRecentChangesLinked
14911491 &$conds: array of WHERE conditionals for query
14921492 &$tables: array of tables to be queried
14931493 &$join_conds: join conditions for the tables
14941494 $opts: FormOptions for this request
14951495 &$query_options: array of options for the database request
 1496+&$select: String '*' or array of columns to select
14961497
14971498 'SpecialSearchNogomatch': called when user clicked the "Go" button but the
14981499 target doesn't exist
Index: branches/wmf/1.16wmf4/includes/specials/SpecialRecentchangeslinked.php
@@ -92,8 +92,8 @@
9393 ChangeTags::modifyDisplayQuery( $tables, $select, $conds, $join_conds,
9494 $query_options, $opts['tagfilter'] );
9595
96 - // XXX: parent class does this, should we too?
97 - // wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) );
 96+ if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) )
 97+ return false;
9898
9999 if( $ns == NS_CATEGORY && !$showlinkedto ) {
100100 // special handling for categories
Index: branches/wmf/1.16wmf4/includes/specials/SpecialRecentchanges.php
@@ -290,6 +290,7 @@
291291 $dbr = wfGetDB( DB_SLAVE );
292292 $limit = $opts['limit'];
293293 $namespace = $opts['namespace'];
 294+ $select = '*';
294295 $invert = $opts['invert'];
295296
296297 // JOIN on watchlist for users
@@ -309,7 +310,7 @@
310311 $tables, $fields, $conds, $join_conds, $query_options, $opts['tagfilter']
311312 );
312313
313 - if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options ) ) )
 314+ if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) )
314315 return false;
315316
316317 // Don't use the new_namespace_time timestamp index if:
@@ -329,7 +330,7 @@
330331 // We have a new_namespace_time index! UNION over new=(0,1) and sort result set!
331332 } else {
332333 // New pages
333 - $sqlNew = $dbr->selectSQLText( $tables, '*',
 334+ $sqlNew = $dbr->selectSQLText( $tables, $select,
334335 array( 'rc_new' => 1 ) + $conds,
335336 __METHOD__,
336337 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit,
Property changes on: branches/wmf/1.16wmf4
___________________________________________________________________
Modified: svn:mergeinfo
337338 Merged /trunk/phase3:r70559,71970

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70559(bug 22514) SpecialRecentChangesQuery should also work on Special:RecentChang...demon13:07, 6 August 2010
r71970Tweak SpecialRecentChangesQuery hook. Need to be able to modify selected fiel...demon19:07, 30 August 2010

Status & tagging log