r62027 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62026‎ | r62027 | r62028 >
Date:15:01, 5 February 2010
Author:ialex
Status:ok
Tags:
Comment:
Follow-up r56441: the cancel link now links to the correct version even on preview
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -1344,6 +1344,8 @@
13451345 $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary );
13461346 $wgOut->addHTML( Xml::hidden( 'wpAutoSummary', $autosumm ) );
13471347
 1348+ $wgOut->addHTML( Xml::hidden( 'oldid', $this->mArticle->getOldID() ) );
 1349+
13481350 if ( $this->section == 'new' ) {
13491351 $this->showSummaryInput( true, $this->summary );
13501352 $wgOut->addHTML( $this->getSummaryPreview( true, $this->summary ) );
@@ -2445,11 +2447,12 @@
24462448
24472449 public function getCancelLink() {
24482450 global $wgUser, $wgTitle;
 2451+
24492452 $cancelParams = array();
2450 - if ( !$this->isConflict && isset( $this->mArticle ) &&
2451 - isset( $this->mArticle->mRevision ) &&
2452 - !$this->mArticle->mRevision->isCurrent() )
2453 - $cancelParams['oldid'] = $this->mArticle->mRevision->getId();
 2453+ if ( !$this->isConflict && $this->mArticle->getOldID() > 0 ) {
 2454+ $cancelParams['oldid'] = $this->mArticle->getOldID();
 2455+ }
 2456+
24542457 return $wgUser->getSkin()->link(
24552458 $wgTitle,
24562459 wfMsgExt( 'cancel', array( 'parseinline' ) ),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56441* (bug 20517) Cancel link from edit page now returns to the old version when ...ialex20:43, 16 September 2009

Status & tagging log