Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -492,7 +492,7 @@ |
493 | 493 | } |
494 | 494 | |
495 | 495 | function maybeUpdateMainCache( &$article, &$outputDone, &$pcache ) { |
496 | | - global $wgUser; |
| 496 | + global $wgUser, $action; |
497 | 497 | // Only trigger on article view for content pages, not for protect/delete/hist |
498 | 498 | if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' ) |
499 | 499 | return true; |
— | — | @@ -501,6 +501,7 @@ |
502 | 502 | if( !$wgUser->isAllowed( 'review' ) ) |
503 | 503 | return true; |
504 | 504 | |
| 505 | + $parserCache =& ParserCache::singleton(); |
505 | 506 | $parserOutput = $parserCache->get( $article, $wgUser ); |
506 | 507 | if( $parserOutput ) { |
507 | 508 | // Clear older, incomplete, cached versions |
— | — | @@ -1310,6 +1311,8 @@ |
1311 | 1312 | $flaggedrevs = new FlaggedArticle(); |
1312 | 1313 | // Main hooks, overrides pages content, adds tags, sets tabs and permalink |
1313 | 1314 | $wgHooks['SkinTemplateTabs'][] = array($flaggedrevs, 'setCurrentTab'); |
| 1315 | +// Update older, incomplete, page caches (ones that lack template Ids/image timestamps) |
| 1316 | +$wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'maybeUpdateMainCache'); |
1314 | 1317 | $wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'setPageContent'); |
1315 | 1318 | $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = array($flaggedrevs, 'setPermaLink'); |
1316 | 1319 | // Add tags do edit view |
— | — | @@ -1321,8 +1324,6 @@ |
1322 | 1325 | $wgHooks['PageHistoryLineEnding'][] = array($flaggedrevs, 'addToHistLine'); |
1323 | 1326 | // Autopromote Editors |
1324 | 1327 | $wgHooks['ArticleSaveComplete'][] = array($flaggedrevs, 'autoPromoteUser'); |
1325 | | -// Update older, incomplete, page caches (ones that lack template Ids/image timestamps) |
1326 | | -$wgHooks['ArticleViewHeader'][] = array($flaggedrevs, 'maybeUpdateMainCache'); |
1327 | 1328 | // Adds table link references to include ones from the stable version |
1328 | 1329 | $wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedrevs, 'extraLinksUpdate'); |
1329 | 1330 | // If a stable version is hidden, move to the next one if possible, and update things |