From 0e710418a0a85cd92b45b10b3900ab1a9426b43a Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 16 Sep 2009 20:43:14 +0000 Subject: [PATCH] * (bug 20517) Cancel link from edit page now returns to the old version when editing an old version --- RELEASE-NOTES | 2 ++ includes/EditPage.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 90fca3bc29..5552371dbc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/EditPage.php b/includes/EditPage.php index bf7bb63c50..3b8d3a0a07 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1196,6 +1196,8 @@ class EditPage { # Enabled article-related sidebar, toplinks, etc. $wgOut->setArticleRelated( true ); + $cancelParams = array(); + if ( $this->isConflict ) { $wgOut->wrapWikiMsg( "
\n$1
", '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' ); -- 2.20.1