r87417 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87416‎ | r87417 | r87418 >
Date:17:45, 4 May 2011
Author:krinkle
Status:ok
Tags:
Comment:
Per IRC discussion, fix confusion by moving the comment up
Modified paths:
  • /trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php
@@ -57,8 +57,9 @@
5858 if ( $params['userrating'] ) {
5959 // User ratings
6060 $userRatings = $this->getUserRatings( $params );
 61+
 62+ // If valid ratings already exist..
6163 if ( isset( $ratings[$params['pageid']]['ratings'] ) ) {
62 - // Valid ratings already exist
6364 foreach ( $ratings[$params['pageid']]['ratings'] as $i => $rating ) {
6465 if ( isset( $userRatings[$rating['ratingid']] ) ) {
6566 // Rating value
@@ -70,11 +71,14 @@
7172 }
7273 }
7374 }
 75+
 76+ // Else, no valid ratings exist..
7477 } else {
75 - // No valid ratings exist
 78+
7679 if ( count( $userRatings ) ) {
7780 $ratings[$params['pageid']]['status'] = 'expired';
7881 }
 82+
7983 foreach ( $userRatings as $ratingId => $userRating ) {
8084 // Revision
8185 if ( !isset( $ratings[$params['pageid']]['revid'] ) ) {
@@ -96,6 +100,7 @@
97101 );
98102 }
99103 }
 104+
100105 // Expertise
101106 if ( isset( $ratings[$params['pageid']]['revid'] ) ) {
102107 $expertise = $this->getExpertise( $params, $ratings[$params['pageid']]['revid'] );

Status & tagging log