r24596 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24595‎ | r24596 | r24597 >
Date:19:15, 4 August 2007
Author:robchurch
Status:old
Tags:
Comment:
* (bug 10805) Fix "undo" link when viewing the diff of the most recent change to a page using "diff=0"
* DifferenceEngine::loadRevisionData() wasn't updating $mNewid when loading the newer revision, which doesn't make too much sense if it ends up left as 0 (which is impossible)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DifferenceEngine.php
@@ -558,16 +558,15 @@
559559 }
560560
561561 // Load the new revision object
562 - if( $this->mNewid ) {
563 - $this->mNewRev = Revision::newFromId( $this->mNewid );
564 - } else {
565 - $this->mNewRev = Revision::newFromTitle( $this->mTitle );
566 - }
567 -
568 - if( is_null( $this->mNewRev ) ) {
 562+ $this->mNewRev = $this->mNewid
 563+ ? Revision::newFromId( $this->mNewid )
 564+ : Revision::newFromTitle( $this->mTitle );
 565+ if( !$this->mNewRev instanceof Revision )
569566 return false;
570 - }
571 -
 567+
 568+ // Update the new revision ID in case it was 0 (makes life easier doing UI stuff)
 569+ $this->mNewid = $this->mNewRev->getId();
 570+
572571 // Set assorted variables
573572 $timestamp = $wgLang->timeanddate( $this->mNewRev->getTimestamp(), true );
574573 $this->mNewPage = $this->mNewRev->getTitle();
@@ -616,7 +615,8 @@
617616 $oldEdit = $this->mOldPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mOldid );
618617 $this->mOldtitle = "<a href='$oldLink'>" . htmlspecialchars( wfMsg( 'revisionasof', $t ) )
619618 . "</a> (<a href='$oldEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)";
620 - //now that we considered old rev, we can make undo link (bug 8133, multi-edit undo)
 619+
 620+ // Add an "undo" link
621621 $newUndo = $this->mNewPage->escapeLocalUrl( 'action=edit&undoafter=' . $this->mOldid . '&undo=' . $this->mNewid);
622622 $this->mNewtitle .= " (<a href='$newUndo'>" . htmlspecialchars( wfMsg( 'editundo' ) ) . "</a>)";
623623 }
Index: trunk/phase3/RELEASE-NOTES
@@ -352,6 +352,8 @@
353353 * Fixed regression in blocking of username '0'
354354 * (bug 9437) Don't overwrite edit form submission handler when setting up
355355 edit box scroll position preserve/restore behaviour
 356+* (bug 10805) Fix "undo" link when viewing the diff of the most recent
 357+ change to a page using "diff=0"
356358
357359 == API changes since 1.10 ==
358360

Follow-up revisions

RevisionCommit summaryAuthorDate
r24631Merged revisions 24480-24600 via svnmerge from...david18:39, 6 August 2007

Status & tagging log