r56576 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56575‎ | r56576 | r56577 >
Date:01:47, 18 September 2009
Author:aaron
Status:ok
Tags:
Comment:
bug 20705: fixed api review; regression from r52882
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/ApiReview.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -379,17 +379,22 @@
380380 $revlink = $this->skin->makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() );
381381 return "<li>$difflink $revlink " . $this->skin->revUserLink($rev) . " " . $this->skin->revComment($rev) . "</li>";
382382 }
 383+
 384+ public function isApproval() {
 385+ # If all values are set to zero, this has been unapproved
 386+ if( !count( FlaggedRevs::getDimensions() ) && $this->approve ) {
 387+ return true; // no tags & approve param given
 388+ }
 389+ foreach( $this->dims as $quality => $value ) {
 390+ if( $value ) return true;
 391+ }
 392+ return false;
 393+ }
383394
384395 public function submit() {
385396 global $wgUser;
386397 # If all values are set to zero, this has been unapproved
387 - $approved = !count( FlaggedRevs::getDimensions() ) && $this->approve;
388 - foreach( $this->dims as $quality => $value ) {
389 - if( $value ) {
390 - $approved = true;
391 - break;
392 - }
393 - }
 398+ $approved = $this->isApproval();
394399 # Double-check permissions
395400 if( !$this->page->quickUserCan('edit') || !self::userCanSetFlags($this->dims,$this->oflags,$this->config) ) {
396401 return array($approved,false);
Index: trunk/extensions/FlaggedRevs/api/ApiReview.php
@@ -82,7 +82,7 @@
8383 if( !$title->quickUserCan('edit') || !RevisionReview::userCanSetFlags($form->dims,$form->oflags,$form->config) )
8484 $this->dieUsage( "You don't have the necessary rights to set the specified flags.", 'permissiondenied' );
8585
86 - if( $form->approve ) {
 86+ if( $form->isApproval() ) {
8787 // Now get the template and image parameters needed
8888 // If it is the current revision, try the parser cache first
8989 $article = new Article( $title, $revid );

Follow-up revisions

RevisionCommit summaryAuthorDate
r56577merged r56576: api review fixaaron01:49, 18 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52882Short-circuited template stuff for API unapproveaaron01:02, 8 July 2009

Status & tagging log