From 1892c2eaedbd2c02361a0480453fcb33d4087070 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 5 Feb 2010 15:01:07 +0000 Subject: [PATCH] Follow-up r56441: the cancel link now links to the correct version even on preview --- includes/EditPage.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 61273b117d..ad9c993275 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1344,6 +1344,8 @@ HTML $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); $wgOut->addHTML( Xml::hidden( 'wpAutoSummary', $autosumm ) ); + $wgOut->addHTML( Xml::hidden( 'oldid', $this->mArticle->getOldID() ) ); + if ( $this->section == 'new' ) { $this->showSummaryInput( true, $this->summary ); $wgOut->addHTML( $this->getSummaryPreview( true, $this->summary ) ); @@ -2445,11 +2447,12 @@ INPUTS public function getCancelLink() { global $wgUser, $wgTitle; + $cancelParams = array(); - if ( !$this->isConflict && isset( $this->mArticle ) && - isset( $this->mArticle->mRevision ) && - !$this->mArticle->mRevision->isCurrent() ) - $cancelParams['oldid'] = $this->mArticle->mRevision->getId(); + if ( !$this->isConflict && $this->mArticle->getOldID() > 0 ) { + $cancelParams['oldid'] = $this->mArticle->getOldID(); + } + return $wgUser->getSkin()->link( $wgTitle, wfMsgExt( 'cancel', array( 'parseinline' ) ), -- 2.20.1