r84208 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84207‎ | r84208 | r84209 >
Date:22:22, 17 March 2011
Author:tparscal
Status:ok
Tags:
Comment:
Switched from using an expired = true in the API result to status = expired | current to better follow API standards and not make XML cry.
Modified paths:
  • /trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -224,8 +224,8 @@
225225 data.query.articlefeedback.length &&
226226 typeof data.query.articlefeedback[0].ratings !== 'undefined'
227227 ) {
228 - if ( 'expired' in data.query.articlefeedback[0] ) {
229 - if ( data.query.articlefeedback[0].expired == true ) {
 228+ if ( 'status' in data.query.articlefeedback[0] ) {
 229+ if ( data.query.articlefeedback[0].status == 'expired' ) {
230230 expired = true;
231231 }
232232 }
Index: trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php
@@ -104,6 +104,7 @@
105105 }
106106
107107 // Ratings can only be expired if the user has rated before
 108+ $ratings[$params['pageid']]['status'] = 'current';
108109 if ( $params['userrating'] && $userRatedArticle ) {
109110 $dbr = wfGetDb( DB_SLAVE );
110111
@@ -121,8 +122,8 @@
122123 );
123124
124125 if ( $res && $dbr->numRows( $res ) > $wgArticleFeedbackRatingLifetime ) {
125 - // Include expired flag
126 - $ratings[$params['pageid']]['expired'] = true;
 126+ // Expired status
 127+ $ratings[$params['pageid']]['status'] = 'expired';
127128 }
128129 }
129130

Follow-up revisions

RevisionCommit summaryAuthorDate
r842101.17wmf1: MFT r84059, r84208catrope22:26, 17 March 2011

Status & tagging log