r72403 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72402‎ | r72403 | r72404 >
Date:09:22, 5 September 2010
Author:ialex
Status:ok
Tags:
Comment:
Per Nikerabbit, fix for r70720: make Translate compatible with 1.16
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -532,7 +532,8 @@
533533 }
534534
535535 public static function replaceMovePage( &$list ) {
536 - $list['Movepage'] = 'SpecialPageTranslationMovePage';
 536+ $old = is_array( $list['Movepage'] );
 537+ $list['Movepage'] = array( 'SpecialPageTranslationMovePage', $old );
537538 return true;
538539 }
539540
Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php
@@ -46,8 +46,14 @@
4747 */
4848 protected $user;
4949
50 - public function __construct() {
 50+ /**
 51+ * Whether MovePageForm extends SpecialPage
 52+ */
 53+ protected $old;
 54+
 55+ public function __construct( $old ) {
5156 parent::__construct( 'Movepage' );
 57+ $this->old = $old;
5258 }
5359
5460 /*
@@ -118,7 +124,11 @@
119125
120126 } else {
121127 // Delegate... don't want to reimplement this
122 - $this->doNormalMovePage( $par );
 128+ if ( $this->old ) {
 129+ $this->doOldNormalMovePage();
 130+ } else {
 131+ $this->doNormalMovePage( $par );
 132+ }
123133 }
124134 }
125135
@@ -160,6 +170,16 @@
161171 $sp->execute( $par );
162172 }
163173
 174+ protected function doOldNormalMovePage() {
 175+ global $wgRequest;
 176+ $form = new MovePageForm( $this->oldTitle, $this->newTitle );
 177+ if ( 'submit' == $wgRequest->getVal( 'action' ) && $this->checkToken() && $wgRequest->wasPosted() ) {
 178+ $form->doSubmit();
 179+ } else {
 180+ $form->showForm( '' );
 181+ }
 182+ }
 183+
164184 /**
165185 * Checks token. Use before real actions happen. Have to use wpEditToken
166186 * for compatibility for SpecialMovepage.php.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70720Modified Special:Movepage to subclass UnlistedSpecialPageialex18:46, 8 August 2010

Status & tagging log