r33126 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33125‎ | r33126 | r33127 >
Date:12:57, 11 April 2008
Author:aaron
Status:old
Tags:
Comment:
Do mTemplates too
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -429,19 +429,25 @@
430430 # Do we need to set the template uses via DB?
431431 if( $reparsed ) {
432432 $dbr = wfGetDB( DB_SLAVE );
433 - $res = $dbr->select( 'flaggedtemplates',
434 - array( 'ft_namespace', 'ft_title', 'ft_tmp_rev_id' ),
435 - array( 'ft_rev_id' => $id ),
 433+ $res = $dbr->select( array('flaggedtemplates', 'revision'),
 434+ array( 'ft_namespace', 'ft_title', 'ft_tmp_rev_id', 'rev_page' ),
 435+ array( 'ft_rev_id' => $id, 'rev_id = ft_rev_id' ),
436436 __METHOD__ );
437437 # Add template metadata to output
438438 $maxTempID = 0;
439439 while( $row = $res->fetchObject() ) {
 440+ if( !isset($parserOut->mTemplates[$row->ft_namespace]) ) {
 441+ $parserOut->mTemplates[$row->ft_namespace] = array();
 442+ }
 443+ $parserOut->mTemplates[$row->ft_namespace][$row->ft_title] = $row->rev_page;
 444+
440445 if( !isset($parserOut->mTemplateIds[$row->ft_namespace]) ) {
441446 $parserOut->mTemplateIds[$row->ft_namespace] = array();
442447 }
443448 $parserOut->mTemplateIds[$row->ft_namespace][$row->ft_title] = $row->ft_tmp_rev_id;
444 - if( $row->ft_tmp_rev_id > $maxTempID )
 449+ if( $row->ft_tmp_rev_id > $maxTempID ) {
445450 $maxTempID = $row->ft_tmp_rev_id;
 451+ }
446452 }
447453 $parserOut->fr_newestTemplateID = $maxTempID;
448454 }

Status & tagging log