r22434 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22433‎ | r22434 | r22435 >
Date:17:26, 25 May 2007
Author:aaron
Status:old
Tags:
Comment:
*Fix garbagy hook call
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -495,6 +495,23 @@
496496 __METHOD__ );
497497 }
498498
 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+
499516 public static function extraLinksUpdate( &$title ) {
500517 $fname = 'FlaggedRevs::extraLinksUpdate';
501518 wfProfileIn( $fname );
@@ -1158,7 +1175,7 @@
11591176 // Adds table link references to include ones from the stable version
11601177 $wgHooks['TitleLinkUpdatesAfterCompletion'][] = array($flaggedrevs, 'extraLinksUpdate');
11611178 // 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');
11631180 // Update our table NS/Titles when things are moved
11641181 $wgHooks['SpecialMovepageAfterMove'][] = array($flaggedrevs, 'updateFromMove');
11651182 // Parser hooks, selects the desired images/templates