From: Rohan Date: Fri, 1 Aug 2014 14:21:12 +0000 (+0530) Subject: SpecialMovepage: Correctly apply target namespace to subpages X-Git-Tag: 1.31.0-rc.0~12589^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=90b6409cb9a0191e159a525d4abe9194da70b8e4;p=lhc%2Fweb%2Fwiklou.git SpecialMovepage: Correctly apply target namespace to subpages 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 --- diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index bd80beca8b..cac324ac00 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -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();