From 1afab4e6e7022d9cba333aae3bb62bf0e773f2ea Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 31 Jan 2005 05:11:12 +0000 Subject: [PATCH] * Attach revision to the new page id. Original article is now accessible again. * missing global $wgUser that produced a notice at hook call * FIXME: sucess redirection for Special:Movepage pass through the parser, breaking the header relocation :-/ --- includes/SpecialMovepage.php | 2 +- includes/Title.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 08c39d9b8e..89922b402f 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -232,4 +232,4 @@ class MovePageForm { } } } -?> +?> \ No newline at end of file diff --git a/includes/Title.php b/includes/Title.php index 565d8ab599..64f5cf29cc 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1344,6 +1344,7 @@ class Title { * @access public */ function moveTo( &$nt, $auth = true ) { + global $wgUser; if( !$this or !$nt ) { return 'badtitletext'; } @@ -1611,6 +1612,9 @@ class Title { $newid = $dbw->insertId(); $wgLinkCache->clearLink( $this->getPrefixedDBkey() ); + // attach revision to the new page + $dbw->update( 'revision', array('rev_page' => $newid), array('rev_id' => $revid), $fname); + # Record in RC // Replaced by a log entry // RecentChange::notifyMoveToNew( $now, $this, $nt, $wgUser, $comment ); @@ -1884,4 +1888,4 @@ class Title { } } -?> +?> \ No newline at end of file -- 2.20.1