From: Alexandre Emsenhuber Date: Fri, 5 Feb 2010 15:01:07 +0000 (+0000) Subject: Follow-up r56441: the cancel link now links to the correct version even on preview X-Git-Tag: 1.31.0-rc.0~37915 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=1892c2eaedbd2c02361a0480453fcb33d4087070;p=lhc%2Fweb%2Fwiklou.git Follow-up r56441: the cancel link now links to the correct version even on preview --- 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' ) ),