r59003 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59002‎ | r59003 | r59004 >
Date:14:11, 13 November 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
Purge caches
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -97,14 +97,27 @@
9898 $source = $page->getTitle();
9999 $target = Title::makeTitle( $source->getNamespace(), $source->getDBkey() . "/$code" );
100100
101 - // FIXME: if $taget->exists() is false, all sister articles should be purged.
102 - $flags &= ~EDIT_NEW & ~EDIT_UPDATE; // We don't know
 101+ // We don't know and don't care
 102+ $flags &= ~EDIT_NEW & ~EDIT_UPDATE;
103103
 104+ // Update the target page
104105 $job = RenderJob::newJob( $target );
105106 $job->setUser( $user );
106107 $job->setSummary( $summary );
107108 $job->setFlags( $flags );
108109 $job->run();
 110+
 111+ // Regenerate translation caches
 112+ $page->getTranslationPercentages( 'force' );
 113+
 114+ // Invalidate caches
 115+ $pages = $page->getTranslationPages();
 116+ $pages[] = $page->getTitle();
 117+ foreach ( $title as $page ) {
 118+ $article = new Article($title);
 119+ $article->doPurge();
 120+ }
 121+
109122 }
110123
111124 public static function addSidebar( $out, $tpl ) {

Status & tagging log