r32341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32340‎ | r32341 | r32342 >
Date:00:53, 23 March 2008
Author:aaron
Status:old
Tags:
Comment:
Check rcid for new page patrol
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -744,9 +744,9 @@
745745 $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action ) );
746746 $form .= "<fieldset><legend>" . wfMsgHtml( 'revreview-flag' ) . "</legend>\n";
747747
748 - if( $wgFlaggedRevsOverride )
 748+ if( $wgFlaggedRevsOverride ) {
749749 $form .= '<p>'.wfMsgExt( 'revreview-text', array('parseinline') ).'</p>';
750 -
 750+ }
751751 $form .= Xml::hidden( 'title', $reviewtitle->getPrefixedText() );
752752 $form .= Xml::hidden( 'target', $wgTitle->getPrefixedText() );
753753 $form .= Xml::hidden( 'oldid', $id );
@@ -806,6 +806,8 @@
807807 }
808808 }
809809 $form .= Xml::hidden( 'imageParams', $imageParams ) . "\n";
 810+ # Pass this in if given; useful for new page patrol
 811+ $form .= Xml::hidden( 'rcid', $wgRequest->getVal('rcid') ) . "\n";
810812
811813 # Special token to discourage fiddling...
812814 $checkCode = FlaggedRevs::getValidationKey( $templateParams, $imageParams, $wgUser->getID() );
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -258,8 +258,9 @@
259259 $form .= $item;
260260 }
261261 # Hack, versioning params
262 - $form .= Xml::hidden( 'templateParams', $this->templateParams );
263 - $form .= Xml::hidden( 'imageParams', $this->imageParams );
 262+ $form .= Xml::hidden( 'templateParams', $this->templateParams ) . "\n";
 263+ $form .= Xml::hidden( 'imageParams', $this->imageParams ) . "\n";
 264+ $form .= Xml::hidden( 'rcid', $this->rcid ) . "\n";
264265 # Special token to discourage fiddling...
265266 $checkCode = FlaggedRevs::getValidationKey( $this->templateParams, $this->imageParams, $wgUser->getID() );
266267 $form .= Xml::hidden( 'validatedParams', $checkCode );
@@ -477,6 +478,16 @@
478479 'rc_timestamp' => $dbw->timestamp( $rev->getTimestamp() ) ),
479480 __METHOD__
480481 );
 482+ # New page patrol may be enabled. If so, the rc_id may be the first
 483+ # edit and not this one. If it is different, mark it too.
 484+ if( $this->rcid && $this->rcid != $rev->getId() ) {
 485+ $dbw->update( 'recentchanges',
 486+ array( 'rc_patrolled' => 1 ),
 487+ array( 'rc_id' => $this->rcid,
 488+ 'rc_type' => RC_NEW ),
 489+ __METHOD__
 490+ );
 491+ }
481492 $dbw->commit();
482493
483494 # Update the article review log

Status & tagging log