http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56441

Revision: 56441
Author:   ialex
Date:     2009-09-16 20:43:14 +0000 (Wed, 16 Sep 2009)

Log Message:
-----------
* (bug 20517) Cancel link from edit page now returns to the old version when 
editing an old version

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/EditPage.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2009-09-16 20:40:24 UTC (rev 56440)
+++ trunk/phase3/RELEASE-NOTES  2009-09-16 20:43:14 UTC (rev 56441)
@@ -502,6 +502,8 @@
 * (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 ==
 

Modified: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php  2009-09-16 20:40:24 UTC (rev 56440)
+++ trunk/phase3/includes/EditPage.php  2009-09-16 20:43:14 UTC (rev 56441)
@@ -1196,6 +1196,8 @@
                # 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 @@
 
                                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 @@
                        $wgTitle,
                        wfMsgExt( 'cancel', array( 'parseinline' ) ),
                        array( 'id' => 'mw-editform-cancel' ),
-                       array(),
+                       $cancelParams,
                        array( 'known', 'noclasses' )
                );
                $separator = wfMsgExt( 'pipe-separator' , 'escapenoentities' );



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to