* (bug 20517) Cancel link from edit page now returns to the old version when editing...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 16 Sep 2009 20:43:14 +0000 (20:43 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 16 Sep 2009 20:43:14 +0000 (20:43 +0000)
RELEASE-NOTES
includes/EditPage.php

index 90fca3b..5552371 100644 (file)
@@ -502,6 +502,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 18180) Special:Export ignores limit, dir, offset parameters
 * User::getBlockedStatus() works for all kinds of user objects and doesn't 
   assume the user object is equal to the current-user object ($wgUser)
+* (bug 20517) Cancel link from edit page now returns to the old version when
+  editing an old version
 
 == API changes in 1.16 ==
 
index bf7bb63..3b8d3a0 100644 (file)
@@ -1196,6 +1196,8 @@ class EditPage {
                # Enabled article-related sidebar, toplinks, etc.
                $wgOut->setArticleRelated( true );
 
+               $cancelParams = array();
+
                if ( $this->isConflict ) {
                        $wgOut->wrapWikiMsg( "<div class='mw-explainconflict'>\n$1</div>", 'explainconflict' );
 
@@ -1246,6 +1248,7 @@ class EditPage {
 
                                if ( !$this->mArticle->mRevision->isCurrent() ) {
                                        $this->mArticle->setOldSubtitle( $this->mArticle->mRevision->getId() );
+                                       $cancelParams['oldid'] = $this->mArticle->mRevision->getId();
                                        $wgOut->addWikiMsg( 'editingold' );
                                }
                        }
@@ -1325,7 +1328,7 @@ class EditPage {
                        $wgTitle,
                        wfMsgExt( 'cancel', array( 'parseinline' ) ),
                        array( 'id' => 'mw-editform-cancel' ),
-                       array(),
+                       $cancelParams,
                        array( 'known', 'noclasses' )
                );
                $separator = wfMsgExt( 'pipe-separator' , 'escapenoentities' );