Index: trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php |
— | — | @@ -57,8 +57,9 @@ |
58 | 58 | if ( $params['userrating'] ) { |
59 | 59 | // User ratings |
60 | 60 | $userRatings = $this->getUserRatings( $params ); |
| 61 | + |
| 62 | + // If valid ratings already exist.. |
61 | 63 | if ( isset( $ratings[$params['pageid']]['ratings'] ) ) { |
62 | | - // Valid ratings already exist |
63 | 64 | foreach ( $ratings[$params['pageid']]['ratings'] as $i => $rating ) { |
64 | 65 | if ( isset( $userRatings[$rating['ratingid']] ) ) { |
65 | 66 | // Rating value |
— | — | @@ -70,11 +71,14 @@ |
71 | 72 | } |
72 | 73 | } |
73 | 74 | } |
| 75 | + |
| 76 | + // Else, no valid ratings exist.. |
74 | 77 | } else { |
75 | | - // No valid ratings exist |
| 78 | + |
76 | 79 | if ( count( $userRatings ) ) { |
77 | 80 | $ratings[$params['pageid']]['status'] = 'expired'; |
78 | 81 | } |
| 82 | + |
79 | 83 | foreach ( $userRatings as $ratingId => $userRating ) { |
80 | 84 | // Revision |
81 | 85 | if ( !isset( $ratings[$params['pageid']]['revid'] ) ) { |
— | — | @@ -96,6 +100,7 @@ |
97 | 101 | ); |
98 | 102 | } |
99 | 103 | } |
| 104 | + |
100 | 105 | // Expertise |
101 | 106 | if ( isset( $ratings[$params['pageid']]['revid'] ) ) { |
102 | 107 | $expertise = $this->getExpertise( $params, $ratings[$params['pageid']]['revid'] ); |