SpecialMovepage: Correctly apply target namespace to subpages
authorRohan <rohan1395@yahoo.com>
Fri, 1 Aug 2014 14:21:12 +0000 (19:51 +0530)
committerTTO <at.light@live.com.au>
Wed, 28 Jan 2015 13:29:04 +0000 (13:29 +0000)
Previously, moving a page from a subject namespace to a talk namespace
(or vice-versa), resulted in the subpages being moved to the new page
name, but still in the old namespace.

Bug: T44024
Change-Id: Iefc5b495e777840dc6a2fe1226b8869d807f2d94

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();