Move log log_page entries are now that of the moved page
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 2 Sep 2014 19:59:18 +0000 (12:59 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 3 Sep 2014 21:44:27 +0000 (14:44 -0700)
bug: 57084
Change-Id: Ibc20d79093eedcdaba1873861e177ca3a6108bca

RELEASE-NOTES-1.24
includes/Title.php

index c5b6cd4..bdf9a11 100644 (file)
@@ -434,6 +434,8 @@ changes to languages because of Bugzilla reports.
   called unconditionally.
 * TablePager::getBody() is now 'final' and can't be overridden in subclasses.
 * TablePager::getBody() is deprecated, use getBodyOutput() or getFullOutput().
+* log_page for move log entries store the original page ID, rather than that 
+  of the new redirect page. This is not retroactive.
 
 ==== Renamed classes ====
 * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
index 7fdeb05..ca292ee 100644 (file)
@@ -3931,9 +3931,13 @@ class Title {
                        $redirectContent = null;
                }
 
+               // bug 57084: log_page should be the ID of the *moved* page
+               $oldid = $this->getArticleID();
+               $logTitle = clone $this;
+
                $logEntry = new ManualLogEntry( 'move', $logType );
                $logEntry->setPerformer( $wgUser );
-               $logEntry->setTarget( $this );
+               $logEntry->setTarget( $logTitle );
                $logEntry->setComment( $reason );
                $logEntry->setParameters( array(
                        '4::target' => $nt->getPrefixedText(),
@@ -3949,8 +3953,6 @@ class Title {
                # Truncate for whole multibyte characters.
                $comment = $wgContLang->truncate( $comment, 255 );
 
-               $oldid = $this->getArticleID();
-
                $dbw = wfGetDB( DB_MASTER );
 
                $newpage = WikiPage::factory( $nt );