Merge "SpecialMovepage: Correctly apply target namespace to subpages"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 28 Jan 2015 13:42:26 +0000 (13:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 28 Jan 2015 13:42:26 +0000 (13:42 +0000)
includes/specials/SpecialMovepage.php

index bd80bec..cac324a 100644 (file)
@@ -698,7 +698,10 @@ class MovePageForm extends UnlistedSpecialPage {
                                $oldSubpage->getDBkey()
                        );
 
-                       if ( $oldSubpage->isTalkPage() ) {
+                       if ( $oldSubpage->isSubpage() && ( $ot->isTalkPage() xor $nt->isTalkPage() ) ) {
+                               // Moving a subpage from a subject namespace to a talk namespace or vice-versa
+                               $newNs = $nt->getNamespace();
+                       } elseif ( $oldSubpage->isTalkPage() ) {
                                $newNs = $nt->getTalkPage()->getNamespace();
                        } else {
                                $newNs = $nt->getSubjectPage()->getNamespace();