Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -97,14 +97,27 @@ |
98 | 98 | $source = $page->getTitle(); |
99 | 99 | $target = Title::makeTitle( $source->getNamespace(), $source->getDBkey() . "/$code" ); |
100 | 100 | |
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; |
103 | 103 | |
| 104 | + // Update the target page |
104 | 105 | $job = RenderJob::newJob( $target ); |
105 | 106 | $job->setUser( $user ); |
106 | 107 | $job->setSummary( $summary ); |
107 | 108 | $job->setFlags( $flags ); |
108 | 109 | $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 | + |
109 | 122 | } |
110 | 123 | |
111 | 124 | public static function addSidebar( $out, $tpl ) { |