r72137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72136‎ | r72137 | r72138 >
Date:18:18, 1 September 2010
Author:reedy
Status:deferred
Tags:
Comment:
Whitespace/bracket position

Return number of revisions since last rating (if considered "stale")
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/api/ApiListArticleAssessment.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/api/ApiListArticleAssessment.php
@@ -22,9 +22,9 @@
2323 $this->addJoinConds( array(
2424 'article_assessment_ratings' => array( 'LEFT JOIN', array(
2525 'aar_id=aap_rating_id',
26 - ) ),
2726 )
28 - );
 27+ ),
 28+ ) );
2929
3030 if ( isset( $params['pageid'] ) ) {
3131 $this->addWhereFld( 'aa_page_id', $params['pageid'] );
@@ -117,9 +117,12 @@
118118
119119 global $wgArticleAssessmentStaleCount;
120120
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+ }
124127 }
125128 }
126129

Status & tagging log