r57748 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57747‎ | r57748 | r57749 >
Date:07:09, 15 October 2009
Author:aaron
Status:ok
Tags:
Comment:
* flaggedpage tracking cleanup for Stabilization
* Removed unused $query var cruft
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -379,6 +379,7 @@
380380 }
381381
382382 $dbw = wfGetDB( DB_MASTER );
 383+ $article = new Article( $this->page );
383384 # Get current config
384385 $row = $dbw->selectRow( 'flaggedpage_config',
385386 array( 'fpc_select', 'fpc_override', 'fpc_level', 'fpc_expiry' ),
@@ -412,11 +413,16 @@
413414 );
414415 }
415416 }
416 - $query = '';
417417 // Check if this actually changed anything...
418418 if( $changed ) {
419419 $id = $this->page->getArticleId();
420420 $latest = $this->page->getLatestRevID( GAID_FOR_UPDATE );
 421+ # Config may have changed to allow stable versions...refresh page
 422+ # tracking to account for any hidden reviewed versions.
 423+ $frev = FlaggedRevision::newFromStable( $this->page, FR_MASTER );
 424+ if( $frev ) {
 425+ FlaggedRevs::updateStableVersion( $article, $frev->getRevision(), $latest );
 426+ }
421427 # ID, accuracy, depth, style
422428 $set = array();
423429 # @FIXME: do this better
@@ -459,7 +465,6 @@
460466 $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
461467 $nullRevId = $nullRevision->insertOn( $dbw );
462468 # Update page record and touch page
463 - $article = new Article( $this->page );
464469 $article->updateRevisionOn( $dbw, $nullRevision, $latest );
465470 wfRunHooks( 'NewRevisionFromEditComplete', array($article, $nullRevision, $latest) );
466471
@@ -477,11 +482,6 @@
478483 $text = $nullRevision->getText();
479484 FlaggedRevs::autoReviewEdit( $article, $wgUser, $text, $nullRevision, $flags, true );
480485 $invalidate = false; // already done with auto-review
481 - // ...otherwise, go to diff if possible
482 - } elseif( $frev ) {
483 - $query = "oldid={$frev->getRevId()}&diff=cur&diffonly=0";
484 - } else {
485 - // can't autoreview and no diff to show...
486486 }
487487 }
488488 # Update the links tables as the stable version may now be the default page...

Status & tagging log