http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96637

Revision: 96637
Author:   bawolff
Date:     2011-09-09 00:40:27 +0000 (Fri, 09 Sep 2011)
Log Message:
-----------
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 ;)

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES-1.19
    trunk/phase3/includes/specials/SpecialMovepage.php

Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19     2011-09-09 00:39:22 UTC (rev 96636)
+++ trunk/phase3/RELEASE-NOTES-1.19     2011-09-09 00:40:27 UTC (rev 96637)
@@ -85,6 +85,8 @@
 * (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.

Modified: trunk/phase3/includes/specials/SpecialMovepage.php
===================================================================
--- trunk/phase3/includes/specials/SpecialMovepage.php  2011-09-09 00:39:22 UTC 
(rev 96636)
+++ trunk/phase3/includes/specials/SpecialMovepage.php  2011-09-09 00:40:27 UTC 
(rev 96637)
@@ -164,8 +164,18 @@
                }
 
                $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 ) {
                        $hasRedirects = $dbr->selectField( 'redirect', '1',
@@ -278,9 +288,7 @@
                        );
                }
 
-               if( ($this->oldTitle->hasSubpages() || 
$this->oldTitle->getTalkPage()->hasSubpages())
-                       && !count( $this->oldTitle->getUserPermissionsErrors( 
'move-subpages', $user ) ) )
-               {
+               if( $canMoveSubpage ) {
                        $out->addHTML( "
                                <tr>
                                        <td></td>


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to