r23137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23136‎ | r23137 | r23138 >
Date:21:11, 20 June 2007
Author:aaron
Status:old
Tags:
Comment:
*Fix fucked up maybeUpdateMainCache() function
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -492,7 +492,7 @@
493493 }
494494
495495 function maybeUpdateMainCache( &$article, &$outputDone, &$pcache ) {
496 - global $wgUser;
 496+ global $wgUser, $action;
497497 // Only trigger on article view for content pages, not for protect/delete/hist
498498 if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' )
499499 return true;
@@ -501,6 +501,7 @@
502502 if( !$wgUser->isAllowed( 'review' ) )
503503 return true;
504504
 505+ $parserCache =& ParserCache::singleton();
505506 $parserOutput = $parserCache->get( $article, $wgUser );
506507 if( $parserOutput ) {
507508 // Clear older, incomplete, cached versions
@@ -1310,6 +1311,8 @@
13111312 $flaggedrevs = new FlaggedArticle();
13121313 // Main hooks, overrides pages content, adds tags, sets tabs and permalink
13131314 $wgHooks['SkinTemplateTabs'][] = array($flaggedrevs, 'setCurrentTab');
 1315+// Update older, incomplete, page caches (ones that lack template Ids/image timestamps)
 1316+$wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'maybeUpdateMainCache');
13141317 $wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'setPageContent');
13151318 $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = array($flaggedrevs, 'setPermaLink');
13161319 // Add tags do edit view
@@ -1321,8 +1324,6 @@
13221325 $wgHooks['PageHistoryLineEnding'][] = array($flaggedrevs, 'addToHistLine');
13231326 // Autopromote Editors
13241327 $wgHooks['ArticleSaveComplete'][] = array($flaggedrevs, 'autoPromoteUser');
1325 -// Update older, incomplete, page caches (ones that lack template Ids/image timestamps)
1326 -$wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'maybeUpdateMainCache');
13271328 // Adds table link references to include ones from the stable version
13281329 $wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedrevs, 'extraLinksUpdate');
13291330 // If a stable version is hidden, move to the next one if possible, and update things

Status & tagging log