Index: trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | 'total' => (int) $row->aap_total, |
50 | 50 | 'count' => (int) $row->aap_count, |
51 | 51 | 'countall' => isset( $historicCounts[$row->aap_rating_id] ) |
52 | | - ? $historicCounts[$row->aap_rating_id] : 0 |
| 52 | + ? (int) $historicCounts[$row->aap_rating_id] : 0 |
53 | 53 | ); |
54 | 54 | } |
55 | 55 | |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | if ( isset( $userRatings[$rating['ratingid']] ) ) { |
70 | 70 | // Rating value |
71 | 71 | $ratings[$params['pageid']]['ratings'][$i]['userrating'] = |
72 | | - $userRatings[$rating['ratingid']]['value']; |
| 72 | + (int) $userRatings[$rating['ratingid']]['value']; |
73 | 73 | // Expiration |
74 | 74 | if ( $userRatings[$rating['ratingid']]['revision'] < $revisionLimit ) { |
75 | 75 | $ratings[$params['pageid']]['status'] = 'expired'; |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | foreach ( $userRatings as $ratingId => $userRating ) { |
85 | 85 | // Revision |
86 | 86 | if ( !isset( $ratings[$params['pageid']]['revid'] ) ) { |
87 | | - $ratings[$params['pageid']]['revid'] = $userRating['revision']; |
| 87 | + $ratings[$params['pageid']]['revid'] = (int) $userRating['revision']; |
88 | 88 | } |
89 | 89 | // Ratings |
90 | 90 | if ( !isset( $ratings[$params['pageid']]['ratings'] ) ) { |
— | — | @@ -95,7 +95,9 @@ |
96 | 96 | 'ratingdesc' => $userRating['text'], |
97 | 97 | 'total' => 0, |
98 | 98 | 'count' => 0, |
99 | | - 'userrating' => $userRating['value'], |
| 99 | + 'countall' => isset( $historicCounts[$row->aap_rating_id] ) |
| 100 | + ? (int) $historicCounts[$row->aap_rating_id] : 0, |
| 101 | + 'userrating' => (int) $userRating['value'], |
100 | 102 | ); |
101 | 103 | } |
102 | 104 | } |
— | — | @@ -184,7 +186,7 @@ |
185 | 187 | __METHOD__, |
186 | 188 | array( |
187 | 189 | 'LIMIT' => count( $wgArticleFeedbackRatings ), |
188 | | - 'ORDER BY' => array( 'aa_rating_id', 'aa_revision DESC' ), |
| 190 | + 'ORDER BY' => array( 'aa_revision DESC', 'aa_rating_id' ), |
189 | 191 | ), |
190 | 192 | array( |
191 | 193 | 'article_feedback_ratings' => array( 'LEFT JOIN', array( 'aar_id=aa_rating_id' ) ) |