r50675 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50674‎ | r50675 | r50676 >
Date:08:51, 17 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Sort pages
* Bug fix for translation page edit prevention
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -97,7 +97,8 @@
9898 'rt_type=rtt_id',
9999 'rtt_name' => array( 'tp:mark', 'tp:tag' ),
100100 );
101 - $res = $dbr->select( $tables, $vars, $conds, __METHOD__ );
 101+ $options = array( 'ORDER BY' => 'page_namespace, page_title' );
 102+ $res = $dbr->select( $tables, $vars, $conds, __METHOD__, $options );
102103 return $res;
103104 }
104105
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -273,14 +273,13 @@
274274 if ( self::$allowTargetEdit ||
275275 $user->getName() === $wgTranslateFuzzyBotName ) return true;
276276
277 - // Proceed to check whether we need to block
278 - $page = TranslatablePage::newFromTitle( $newtitle );
279277 if ( $page->getMarkedTag() ) {
 278+ list( , $code ) = TranslateUtils::figureMessage( $title->getText() );
280279 wfLoadExtensionMessages( 'PageTranslation' );
281280 $result = array(
282281 'tpt-target-page',
283 - $newtitle->getPrefixedText(),
284 - $page->getTranslationUrl( $title->getSubpageText() )
 282+ $page->getTitle()->getPrefixedText(),
 283+ $page->getTranslationUrl( $code )
285284 );
286285 return false;
287286 }

Status & tagging log