(bug 3047) Don't mention talk pages on Special:Movepage when there isn't one
authorRob Church <robchurch@users.mediawiki.org>
Sun, 19 Mar 2006 04:43:57 +0000 (04:43 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 19 Mar 2006 04:43:57 +0000 (04:43 +0000)
RELEASE-NOTES
includes/SpecialMovepage.php
languages/Messages.php

index 344548c..6e3bd53 100644 (file)
@@ -375,7 +375,8 @@ Special Pages:
   list pages with less than this number of links. Defaults to 1.
 * (bug 4319) Don't show a "create account" link on the login form when
   account creation is disabled.
-* Javascript filter for Special:Allmessages
+* JavaScript filter for Special:Allmessages
+* (bug 3047) Don't mention talk pages on Special:Movepage when there isn't one
 
 Misc.:
 * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect
index 36ecc31..4f795c2 100644 (file)
@@ -107,7 +107,10 @@ class MovePageForm {
                        $confirm = false;
                }
 
-               if ( !$ot->isTalkPage() ) {
+               $oldTalk = $ot->getTalkPage();
+               $considerTalk = ( !$ot->isTalkPage() && $oldTalk->exists() );
+
+               if ( $considerTalk ) {
                        $wgOut->addWikiText( wfMsg( 'movepagetalktext' ) );
                }
 
@@ -148,7 +151,7 @@ class MovePageForm {
                        </td>
                </tr>" );
 
-               if ( ! $ot->isTalkPage() ) {
+               if ( $considerTalk ) {
                        $wgOut->addHTML( "
                <tr>
                        <td align='right'>
@@ -206,28 +209,26 @@ class MovePageForm {
 
                wfRunHooks( 'SpecialMovepageAfterMove', array( &$this , &$ot , &$nt ) ) ;
 
-               # Move talk page if
-               # (1) the checkbox says to,
-               # (2) the namespaces are not themselves talk namespaces, and of course
-               # (3) it exists.
-               if ( ( $wgRequest->getVal('wpMovetalk') == 1 ) &&
-                    !$ot->isTalkPage() &&
-                    !$nt->isTalkPage() ) {
-
-                       $ott = $ot->getTalkPage();
-                       $ntt = $nt->getTalkPage();
-
-                       # Attempt the move
-                       $error = $ott->moveTo( $ntt, true, $this->reason );
-                       if ( $error === true ) {
-                               $talkmoved = 1;
-                               wfRunHooks( 'SpecialMovepageAfterMove', array( &$this , &$ott , &$ntt ) )       ;
+               # Move the talk page if relevant, if it exists, and if we've been told to
+               $ott = $ot->getTalkPage();
+               if( $ott->exists() ) {
+                       if( $wgRequest->getVal( 'wpMovetalk' ) == 1 && !$ot->isTalkPage() && !$nt->isTalkPage() ) {
+                               $ntt = $nt->getTalkPage();
+       
+                               # Attempt the move
+                               $error = $ott->moveTo( $ntt, true, $this->reason );
+                               if ( $error === true ) {
+                                       $talkmoved = 1;
+                                       wfRunHooks( 'SpecialMovepageAfterMove', array( &$this , &$ott , &$ntt ) )       ;
+                               } else {
+                                       $talkmoved = $error;
+                               }
                        } else {
-                               $talkmoved = $error;
+                               # Stay silent on the subject of talk.
+                               $talkmoved = '';
                        }
                } else {
-                       # Stay silent on the subject of talk.
-                       $talkmoved = '';
+                       $talkmoved = 'notalkpage';
                }
 
                # Give back result to user.
@@ -263,7 +264,7 @@ class MovePageForm {
                        $wgOut->addWikiText( wfMsg( 'talkexists' ) );
                } else {
                        $oldTitle = Title::newFromText( $oldText );
-                       if ( !$oldTitle->isTalkPage() ) {
+                       if ( !$oldTitle->isTalkPage() && $talkmoved != 'notalkpage' ) {
                                $wgOut->addWikiText( wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) );
                        }
                }
index cd01f03..606c565 100644 (file)
@@ -1372,11 +1372,9 @@ to move a page.",
 'articleexists' => 'A page of that name already exists, or the
 name you have chosen is not valid.
 Please choose another name.',
-'talkexists'   => "'''The page itself was moved successfully, but the
-talk page could not be moved because one already exists at the new
-title. Please merge them manually.'''",
+'talkexists'   => "'''The page itself was moved successfully, but the talk page could not be moved because one already exists at the new title. Please merge them manually.'''",
 'movedto'              => 'moved to',
-'movetalk'             => 'Move "talk" page as well, if applicable.',
+'movetalk'             => 'Move associated talk page',
 'talkpagemoved' => 'The corresponding talk page was also moved.',
 'talkpagenotmoved' => 'The corresponding talk page was <strong>not</strong> moved.',
 '1movedto2'            => '[[$1]] moved to [[$2]]',