r60109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60108‎ | r60109 | r60110 >
Date:00:11, 16 December 2009
Author:aaron
Status:ok
Tags:
Comment:
* Clear unreviewed rev count cache on edit
* Refactored $pending check in code
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -898,7 +898,7 @@
899899 * @param Article $article
900900 * @param Revision $rev, the new stable version
901901 * @param mixed $latest, the latest rev ID (optional)
902 - * Updates the flaggedpages fields
 902+ * Updates the flaggedpages fields. Called on edit.
903903 */
904904 public static function updateStableVersion( $article, $rev, $latest = NULL ) {
905905 if( !$article->getId() )
@@ -943,6 +943,8 @@
944944 'fp_pending_since' => $nextTimestamp ? $dbw->timestamp($nextTimestamp) : null ),
945945 __METHOD__
946946 );
 947+ # Reset cache of # of unreviewed revs
 948+ self::getRevCountSince( $article, $revId, true );
947949 # Alter pending edit tracking table
948950 self::updatePendingList( $article, $latest );
949951 return true;
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -305,6 +305,8 @@
306306 $this->maybeShowTopDiff( $srev, $quality ); // user may want diff (via prefs)
307307 }
308308 $pending = '';
 309+ # If they are synced, do special styling
 310+ $simpleTag = !$synced;
309311 # Give notice to newer users if an unreviewed edit was completed...
310312 if( !$synced && $wgRequest->getVal('shownotice') && !$wgUser->isAllowed('review') ) {
311313 $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
@@ -314,12 +316,10 @@
315317 $pending = "<div id='mw-reviewnotice' class='flaggedrevs_preview plainlinks'>$pending</div>";
316318 # Notice should always use subtitle
317319 $this->reviewNotice = $pending;
318 - }
319 - # If they are synced, do special styling
320 - $simpleTag = !$synced;
321320 # Construct some tagging for non-printable outputs. Note that the pending
322321 # notice has all this info already, so don't do this if we added that already.
323 - if( !$wgOut->isPrintable() && !$pending && !($this->article->lowProfileUI() && $synced) ) {
 322+ # Also, if low profile UI is enabled and the page is synced, skip the tag.
 323+ } else if( !$wgOut->isPrintable() && !($this->article->lowProfileUI() && $synced) ) {
324324 $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
325325 $class = 'fr-icon-current'; // default
326326 $tooltip = 'revreview-draft-title';

Status & tagging log