Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | if ( $revision === -1 ) { |
61 | 61 | $page = TranslatablePage::newFromTitle( $title ); |
62 | 62 | $page->removeTags(); |
| 63 | + $page->getTitle()-invalidateCache(); |
63 | 64 | global $wgUser; |
64 | 65 | $logger = new LogPage( 'pagetranslation' ); |
65 | 66 | $params = array( 'user' => $wgUser->getName() ); |
— | — | @@ -166,18 +167,14 @@ |
167 | 168 | // Pages where mark <= tag |
168 | 169 | $items = array(); |
169 | 170 | foreach ( $pages as $index => $page ) { |
170 | | - if ( !isset( $page['tp:mark'] ) ) { |
| 171 | + if ( !isset( $page['tp:mark'] ) || !isset( $page['tp:tag'] ) ) { |
171 | 172 | continue; |
172 | 173 | } |
173 | 174 | |
174 | | - if ( !isset( $page['tp:tag'] ) ) { |
| 175 | + if ( $page['tp:tag'] !== $page['title']->getLatestRevID() ) { |
175 | 176 | continue; |
176 | 177 | } |
177 | 178 | |
178 | | - if ( $page['tp:mark'] > $page['tp:tag'] ) { |
179 | | - continue; |
180 | | - } |
181 | | - |
182 | 179 | $link = $this->user->getSkin()->link( $page['title'] ); |
183 | 180 | $acts = $this->actionLinks( $page['title'], $page['tp:mark'], 'old' ); |
184 | 181 | $items[] = "<li>$link ($acts) </li>"; |
— | — | @@ -193,16 +190,19 @@ |
194 | 191 | // Pages which are never marked |
195 | 192 | $items = array(); |
196 | 193 | foreach ( $pages as $index => $page ) { |
197 | | - if ( isset( $page['tp:mark'] ) ) { |
| 194 | + if ( isset( $page['tp:mark'] ) || !isset( $page['tp:tag'] ) ) { |
198 | 195 | continue; |
199 | 196 | } |
200 | 197 | |
201 | | - if ( !isset( $page['tp:tag'] ) ) { |
| 198 | + /* Ignore pages which have had <translate> at some point, but which |
| 199 | + * have never been marked. */ |
| 200 | + if ( $page['title']->getLatestRevID() !== $page['tp:tag'] ) { |
| 201 | + unset( $pages[$index] ); |
202 | 202 | continue; |
203 | 203 | } |
204 | 204 | |
205 | 205 | $link = $this->user->getSkin()->link( $page['title'] ); |
206 | | - $acts = $this->actionLinks( $page['title'], $page['tp:tag'], 'old' ); |
| 206 | + $acts = $this->actionLinks( $page['title'], $page['tp:tag'], 'new' ); |
207 | 207 | $items[] = "<li>$link ($acts) </li>"; |
208 | 208 | |
209 | 209 | unset( $pages[$index] ); |
— | — | @@ -497,6 +497,7 @@ |
498 | 498 | ); |
499 | 499 | $logger->addEntry( 'mark', $page->getTitle(), null, array( serialize( $params ) ) ); |
500 | 500 | |
| 501 | + $page->getTitle()-invalidateCache(); |
501 | 502 | $this->setupRenderJobs( $page ); |
502 | 503 | |
503 | 504 | // Re-generate caches |
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -343,7 +343,7 @@ |
344 | 344 | |
345 | 345 | return false; |
346 | 346 | } |
347 | | - } elseif ( $action === 'move' ) { |
| 347 | + } elseif ( $action === 'move' || $action === 'delete' ) { |
348 | 348 | $page = TranslatablePage::newFromTitle( $title ); |
349 | 349 | if ( $page->getMarkedTag() ) { |
350 | 350 | $result = array( 'tpt-move-impossible' ); |