* Attach revision to the new page id. Original article is now accessible again.
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 31 Jan 2005 05:11:12 +0000 (05:11 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 31 Jan 2005 05:11:12 +0000 (05:11 +0000)
* 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
includes/Title.php

index 08c39d9..89922b4 100644 (file)
@@ -232,4 +232,4 @@ class MovePageForm {
                }
        }
 }
-?>
+?>
\ No newline at end of file
index 565d8ab..64f5cf2 100644 (file)
@@ -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