Index: trunk/extensions/ArticleAssessmentPilot/api/ApiListArticleAssessment.php |
— | — | @@ -22,9 +22,9 @@ |
23 | 23 | $this->addJoinConds( array( |
24 | 24 | 'article_assessment_ratings' => array( 'LEFT JOIN', array( |
25 | 25 | 'aar_id=aap_rating_id', |
26 | | - ) ), |
27 | 26 | ) |
28 | | - ); |
| 27 | + ), |
| 28 | + ) ); |
29 | 29 | |
30 | 30 | if ( isset( $params['pageid'] ) ) { |
31 | 31 | $this->addWhereFld( 'aa_page_id', $params['pageid'] ); |
— | — | @@ -117,9 +117,12 @@ |
118 | 118 | |
119 | 119 | global $wgArticleAssessmentStaleCount; |
120 | 120 | |
121 | | - if ( $res && $res->fetchRow()->norevs > $wgArticleAssessmentStaleCount ){ |
122 | | - //it's stale! |
123 | | - $ratings[$params['pageid']]['stale'] = ''; |
| 121 | + if ( $res ) { |
| 122 | + $noOfRevs = $res->fetchRow()->norevs; |
| 123 | + if ( $noOfRevs > $wgArticleAssessmentStaleCount ){ |
| 124 | + //it's stale! |
| 125 | + $ratings[$params['pageid']]['stale'] = intval( $noOfRevs ); |
| 126 | + } |
124 | 127 | } |
125 | 128 | } |
126 | 129 | |