Index: trunk/extensions/Translate/tag/SpecialPageTranslationDeletePage.php |
— | — | @@ -316,6 +316,7 @@ |
317 | 317 | $this->page->removeTags(); |
318 | 318 | } |
319 | 319 | |
| 320 | + $this->clearMetadata(); |
320 | 321 | MessageGroups::clearCache(); |
321 | 322 | MessageIndexRebuildJob::newJob()->insert(); |
322 | 323 | |
— | — | @@ -323,6 +324,14 @@ |
324 | 325 | $wgOut->addWikiMsg( 'pt-deletepage-started' ); |
325 | 326 | } |
326 | 327 | |
| 328 | + protected function clearMetadata() { |
| 329 | + // remove the entries from metadata table. |
| 330 | + $groupId = $this->page->getMessageGroupId(); |
| 331 | + TranslateMetadata::set( $groupId, 'prioritylangs', false ); |
| 332 | + TranslateMetadata::set( $groupId, 'priorityforce', false ); |
| 333 | + TranslateMetadata::set( $groupId, 'priorityreason', false ); |
| 334 | + } |
| 335 | + |
327 | 336 | /** |
328 | 337 | * Returns all section pages, including those which are currently not active. |
329 | 338 | * @return TitleArray. |
Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php |
— | — | @@ -396,6 +396,11 @@ |
397 | 397 | $newTpage->addMarkedTag( $this->newTitle->getLatestRevId( Title::GAID_FOR_UPDATE ) ); |
398 | 398 | } |
399 | 399 | |
| 400 | + // remove the entries from metadata table. |
| 401 | + $oldGroupId = $this->page->getMessageGroupId(); |
| 402 | + $newGroupId = $newTpage->getMessageGroupId(); |
| 403 | + $this->moveMetadata( $oldGroupId, $newGroupId ); |
| 404 | + |
400 | 405 | MessageGroups::clearCache(); |
401 | 406 | MessageIndexRebuildJob::newJob()->insert(); |
402 | 407 | |
— | — | @@ -403,6 +408,24 @@ |
404 | 409 | $wgOut->addWikiMsg( 'pt-movepage-started' ); |
405 | 410 | } |
406 | 411 | |
| 412 | + protected function moveMetadata( $oldGroupId, $newGroupId ) { |
| 413 | + $prioritylangs = TranslateMetadata::get( $oldGroupId, 'prioritylangs' ); |
| 414 | + $priorityforce = TranslateMetadata::get( $oldGroupId, 'priorityforce' ); |
| 415 | + $priorityreason = TranslateMetadata::get( $oldGroupId, 'priorityreason' ); |
| 416 | + TranslateMetadata::set( $oldGroupId, 'prioritylangs', false ); |
| 417 | + TranslateMetadata::set( $oldGroupId, 'priorityforce', false ); |
| 418 | + TranslateMetadata::set( $oldGroupId, 'priorityreason', false ); |
| 419 | + if ( $prioritylangs ) { |
| 420 | + TranslateMetadata::set( $newGroupId, 'prioritylangs', $prioritylangs ); |
| 421 | + } |
| 422 | + if ( $priorityforce ) { |
| 423 | + TranslateMetadata::set( $newGroupId, 'priorityforce', $priorityforce ); |
| 424 | + } |
| 425 | + if ( $priorityreason ) { |
| 426 | + TranslateMetadata::set( $newGroupId, 'priorityreason', $priorityreason ); |
| 427 | + } |
| 428 | + } |
| 429 | + |
407 | 430 | protected function checkMoveBlockers() { |
408 | 431 | $blockers = array(); |
409 | 432 | |