From 1d85558a7aebb917983980cb88ca4b1185f85496 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 23 May 2008 21:22:54 +0000 Subject: [PATCH] Fix bug: we still need to move subpages if we're moving the talk page, and the talk namespace allows subpages. --- includes/SpecialMovepage.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index e32b7098d2..e98f6e5bce 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -304,28 +304,29 @@ class MovePageForm { $this->moveTalk = false; } - # If the target namespace doesn't allow subpages, moving with subpages - # would mean that you couldn't move them back in one operation, which - # is bad. - # - # FIXME: A specific error message should be given in this case. - if( empty( $wgNamespacesWithSubpages[$nt->getNamespace()] ) ) { - $this->moveSubpages = false; - } - # Next make a list of id's. This might be marginally less efficient # than a more direct method, but this is not a highly performance-cri- # tical code path and readable code is more important here. # # Note: this query works nicely on MySQL 5, but the optimizer in MySQL # 4 might get confused. If so, consider rewriting as a UNION. + # + # If the target namespace doesn't allow subpages, moving with subpages + # would mean that you couldn't move them back in one operation, which + # is bad. FIXME: A specific error message should be given in this + # case. $dbr = wfGetDB( DB_SLAVE ); - if( $this->moveSubpages ) { + if( $this->moveSubpages && ( + !empty($wgNamespacesWithSubpages[$nt->getNamespace()]) || ( + $this->moveTalk && + !empty( $wgNamespacesWithSubpages[$nt->getTalkPage()->getNamespace()] ) + ) + ) ) { $conds = array( 'page_title LIKE '.$dbr->addQuotes( $dbr->escapeLike( $ot->getDBkey() ) . '/%' ) .' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() ) ); - if( $this->moveTalk ) { + if( $this->moveTalk && !empty( $wgNamespacesWithSubpages[$nt->getTalkPage()->getNamespace()] ) ) { $conds['page_namespace'] = array( $ot->getNamespace(), MWNamespace::getTalk($ot->getNamespace()) ); } else { -- 2.20.1