Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -495,6 +495,23 @@ |
496 | 496 | __METHOD__ ); |
497 | 497 | } |
498 | 498 | |
| 499 | + public static function articleLinksUpdate( &$title ) { |
| 500 | + global $wgUser, $wgParser; |
| 501 | + |
| 502 | + $article = new Article( $title ); |
| 503 | + // Update the links tables as the stable version may now be the default page... |
| 504 | + $parserCache =& ParserCache::singleton(); |
| 505 | + $poutput = $parserCache->get( $article, $wgUser ); |
| 506 | + if( $poutput==false ) { |
| 507 | + $text = $article->getContent(); |
| 508 | + $poutput = $wgParser->parse($text, $article->mTitle, ParserOptions::newFromUser($wgUser)); |
| 509 | + # Might as well save the cache while we're at it |
| 510 | + $parserCache->save( $poutput, $article, $wgUser ); |
| 511 | + } |
| 512 | + $u = new LinksUpdate( $title, $poutput ); |
| 513 | + $u->doUpdate(); // this will trigger our hook to add stable links too... |
| 514 | + } |
| 515 | + |
499 | 516 | public static function extraLinksUpdate( &$title ) { |
500 | 517 | $fname = 'FlaggedRevs::extraLinksUpdate'; |
501 | 518 | wfProfileIn( $fname ); |
— | — | @@ -1158,7 +1175,7 @@ |
1159 | 1176 | // Adds table link references to include ones from the stable version |
1160 | 1177 | $wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedrevs, 'extraLinksUpdate'); |
1161 | 1178 | // If a stable version is hidden, move to the next one if possible, and update things |
1162 | | -$wgHooks['ArticleRevisionVisiblityUpdates'][] = array($flaggedrevs, 'extraLinksUpdate'); |
| 1179 | +$wgHooks['ArticleRevisionVisiblityUpdates'][] = array($flaggedrevs, 'articleLinksUpdate'); |
1163 | 1180 | // Update our table NS/Titles when things are moved |
1164 | 1181 | $wgHooks['SpecialMovepageAfterMove'][] = array($flaggedrevs, 'updateFromMove'); |
1165 | 1182 | // Parser hooks, selects the desired images/templates |