From b8f10c5d658bb87f7aa089345f2fce84b9464af6 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 9 Sep 2011 00:40:27 +0000 Subject: [PATCH] Show the "Move associated talk page button" on special:movepage if there are subpages in the corresponding talk page that could be affected by it, even if the base page being moved does not have a talk page. (I just had a discussion with mindrones on irc about how the current behaviour with the talkspace subpages sometimes being moved by "move subpages" button and sometimes not depending on if current page had a talk page (and thus had the move assoc. talk button auto checked) was really confusing to the average user.) As an aside, Special:Movepage could probably do with some refactoring ;) --- RELEASE-NOTES-1.19 | 2 ++ includes/specials/SpecialMovepage.php | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 1d1c5a5e3e..1b8c3db00e 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -85,6 +85,8 @@ production. * (bug 23057) Importers no longer can 'edit' or 'create' a fully-protected page by importing a new revision into it * (bug 30192) Thumbnails of archived files are now deleted +* Allowing moving the associated talk pages of subpages even if the base page + has no subpage. === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 7a5a4210fb..8fa44a0ab2 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -164,7 +164,17 @@ class MovePageForm extends UnlistedSpecialPage { } $oldTalk = $this->oldTitle->getTalkPage(); - $considerTalk = ( !$this->oldTitle->isTalkPage() && $oldTalk->exists() ); + $oldTitleSubpages = $this->oldTitle->hasSubpages(); + $oldTitleTalkSubpages = $this->oldTitle->getTalkPage()->hasSubpages(); + + $canMoveSubpage = ( $oldTitleSubpages || $oldTitleTalkSubpages ) && + !count( $this->oldTitle->getUserPermissionsErrors( 'move-subpages', $user ) ); + + # We also want to be able to move assoc. subpage talk-pages even if base page + # has no associated talk page, so || with $oldTitleTalkSubpages. + $considerTalk = !$this->oldTitle->isTalkPage() && + ( $oldTalk->exists() + || ( $oldTitleTalkSubpages && $canMoveSubpage ) ); $dbr = wfGetDB( DB_SLAVE ); if ( $wgFixDoubleRedirects ) { @@ -278,9 +288,7 @@ class MovePageForm extends UnlistedSpecialPage { ); } - if( ($this->oldTitle->hasSubpages() || $this->oldTitle->getTalkPage()->hasSubpages()) - && !count( $this->oldTitle->getUserPermissionsErrors( 'move-subpages', $user ) ) ) - { + if( $canMoveSubpage ) { $out->addHTML( " -- 2.20.1