r41243 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41242‎ | r41243 | r41244 >
Date:07:09, 25 September 2008
Author:aaron
Status:old
Tags:
Comment:
* $extraQuery may need an & if another hook from something added stuff
* Jump to diff on config setting as needed so people don't leave outdated pages as the default by mistake.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -1186,6 +1186,7 @@
11871187 // If we are supposed to review after edit, and it was not autoreviewed,
11881188 // and the user can actually make new stable version, take us to the diff...
11891189 if( $wgReviewChangesAfterEdit && $frev && $latest > $frev->getRevId() && $frev->userCanSetFlags() ) {
 1190+ $extraQuery .= $extraQuery ? '&' : '';
11901191 $extraQuery .= "oldid={$frev->getRevId()}&diff=cur&diffonly=0"; // override diff-only
11911192 // ...otherwise, go to the current revision after completing an edit.
11921193 } else {
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -283,7 +283,17 @@
284284 $wgUser->removeWatch( $this->page );
285285 }
286286
287 - $wgOut->redirect( $this->page->getFullUrl() );
 287+ $query = '';
 288+ # Take the user to the diff to make sure an outdated version isn't
 289+ # being set at the default. This is really an issue with configs
 290+ # that only let certain pages be reviewed.
 291+ if( $this->select == FLAGGED_VIS_NORMAL ) {
 292+ $frev = FlaggedRevision::newFromStable( $this->page, FR_MASTER );
 293+ if( $frev && $frev->getRevId() != $latest ) {
 294+ $query = "oldid={$frev->getRevId()}&diff=cur&diffonly=0"; // override diff-only
 295+ }
 296+ }
 297+ $wgOut->redirect( $this->page->getFullUrl( $query ) );
288298
289299 return true;
290300 }