Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -429,19 +429,25 @@ |
430 | 430 | # Do we need to set the template uses via DB? |
431 | 431 | if( $reparsed ) { |
432 | 432 | $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' ), |
436 | 436 | __METHOD__ ); |
437 | 437 | # Add template metadata to output |
438 | 438 | $maxTempID = 0; |
439 | 439 | 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 | + |
440 | 445 | if( !isset($parserOut->mTemplateIds[$row->ft_namespace]) ) { |
441 | 446 | $parserOut->mTemplateIds[$row->ft_namespace] = array(); |
442 | 447 | } |
443 | 448 | $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 ) { |
445 | 450 | $maxTempID = $row->ft_tmp_rev_id; |
| 451 | + } |
446 | 452 | } |
447 | 453 | $parserOut->fr_newestTemplateID = $maxTempID; |
448 | 454 | } |