r36344 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36343‎ | r36344 | r36345 >
Date:19:28, 16 June 2008
Author:aaron
Status:old
Tags:
Comment:
Diff link tweaks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -1977,9 +1977,10 @@
19781978 # Show link to page with oldid=x
19791979 if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($paramArray[0]) ) {
19801980 global $wgUser;
1981 - if( !empty($paramArray[1]) ) {
 1981+ # Don't show diff if param missing or rev IDs are the same
 1982+ if( !empty($paramArray[1]) && $paramArray[0] != $paramArray[1] ) {
19821983 $r = '(' . $wgUser->getSkin()->makeKnownLinkObj( $title, wfMsgHtml('review-logentry-diff'),
1983 - "oldid={$paramArray[1]}&diff={$paramArray[0]}") . ')';
 1984+ "oldid={$paramArray[1]}&diff={$paramArray[0]}") . ') ';
19841985 } else {
19851986 $r = '(' . wfMsgHtml('review-logentry-diff') . ')';
19861987 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -666,10 +666,6 @@
667667 global $wgUser, $wgParser, $wgRevisionCacheExpiry, $wgMemc;
668668 wfProfileIn( __METHOD__ );
669669
670 - # Get current stable version ID (for logging)
671 - $oldSv = FlaggedRevision::newFromStable( $this->page, false, true );
672 - $oldSvId = $oldSv ? $oldSv->getRevId() : 0;
673 -
674670 $dbw = wfGetDB( DB_MASTER );
675671 $dbw->begin();
676672 # Delete from flaggedrevs table
@@ -680,6 +676,10 @@
681677 $dbw->delete( 'flaggedimages', array( 'fi_rev_id' => $frev->getRevId() ) );
682678 $dbw->commit();
683679
 680+ # Get current stable version ID (for logging)
 681+ $oldSv = FlaggedRevision::newFromStable( $this->page, false, true );
 682+ $oldSvId = $oldSv ? $oldSv->getRevId() : 0;
 683+
684684 # Update the article review log
685685 $this->updateLog( $this->page, $this->dims, $this->oflags, $this->comment, $this->oldid, $oldSvId, false );
686686

Status & tagging log