r72568 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72567‎ | r72568 | r72569 >
Date:23:56, 7 September 2010
Author:reedy
Status:ok
Tags:
Comment:
Limit queries to the values of $wgArticleAssessmentRatings when doing selects for ratings

Rem dupe global
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/api/ApiQueryArticleAssessment.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/api/ApiQueryArticleAssessment.php
@@ -5,6 +5,7 @@
66 }
77
88 public function execute() {
 9+ global $wgArticleAssessmentRatings;
910 $params = $this->extractRequestParams();
1011
1112 $result = $this->getResult();
@@ -16,6 +17,7 @@
1718 $this->addJoinConds( array(
1819 'article_assessment_ratings' => array( 'LEFT JOIN', array(
1920 'aar_id=aap_rating_id',
 21+ 'aap_rating_id' => $wgArticleAssessmentRatings,
2022 )
2123 ),
2224 ) );
@@ -52,8 +54,6 @@
5355
5456 $this->addOption( 'ORDER BY', 'aa_revision DESC' );
5557 }
56 -
57 - global $wgArticleAssessmentRatings;
5858
5959 $this->addOption( 'LIMIT', count( $wgArticleAssessmentRatings ) );
6060
Index: trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php
@@ -20,8 +20,6 @@
2121 }
2222
2323 $dbr = wfGetDB( DB_SLAVE );
24 -
25 - global $wgArticleAssessmentRatings;
2624
2725 // Query the latest ratings by this user for this page,
2826 // possibly for an older revision
@@ -35,6 +33,7 @@
3634 'aa_user_id' => $wgUser->getId(),
3735 'aa_user_text' => $wgUser->getName(),
3836 'aa_page_id' => $params['pageid'],
 37+ 'aa_rating_id' => $wgArticleAssessmentRatings,
3938 ),
4039 $token
4140 ),

Status & tagging log