From 9372c87888faee69240c7ae641d4aabd1d9dfd13 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 2 Sep 2014 12:59:18 -0700 Subject: [PATCH] Move log log_page entries are now that of the moved page bug: 57084 Change-Id: Ibc20d79093eedcdaba1873861e177ca3a6108bca --- RELEASE-NOTES-1.24 | 2 ++ includes/Title.php | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index c5b6cd45fd..bdf9a11390 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -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 diff --git a/includes/Title.php b/includes/Title.php index 7fdeb05511..ca292eefcf 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ); -- 2.20.1