Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/82865


Change subject: Refactor out the path of the campaign in the API result
......................................................................

Refactor out the path of the campaign in the API result

Change-Id: I937b769677dc9e38f4b4f951d2e712b45575c149
---
M includes/ApiQueryAllCampaigns.php
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/65/82865/1

diff --git a/includes/ApiQueryAllCampaigns.php 
b/includes/ApiQueryAllCampaigns.php
index 75f9688..8db6b3b 100644
--- a/includes/ApiQueryAllCampaigns.php
+++ b/includes/ApiQueryAllCampaigns.php
@@ -66,30 +66,34 @@
                                $this->setContinueEnumParameter( 'continue', 
$row->campaign_id );
                                break;
                        }
+
                        $campaign = UploadWizardCampaign::newFromName( 
$row->campaign_name );
+
+                       $campaignPath = array( 'query', $this->getModuleName(), 
$row->campaign_id );
+
                        $result->addValue(
-                               array( 'query', $this->getModuleName(), 
$row->campaign_id ),
+                               $campaignPath,
                                '*',
                                json_encode( $campaign->getParsedConfig() )
                        );
                        $result->addValue(
-                               array( 'query', $this->getModuleName(), 
$row->campaign_id ),
+                               $campaignPath,
                                'name',
                                $campaign->getName()
                        );
                        $result->addValue(
-                               array( 'query', $this->getModuleName(), 
$row->campaign_id ),
+                               $campaignPath,
                                'trackingCategory',
                                $campaign->getTrackingCategory()->getDBKey()
                        );
                        $result->addValue(
-                               array( 'query', $this->getModuleName(), 
$row->campaign_id ),
+                               $campaignPath,
                                'totalUploads',
                                $campaign->getUploadedMediaCount()
                        );
                        if ( UploadWizardConfig::getSetting( 
'campaignExpensiveStatsEnabled' ) === true ) {
                                $result->addValue(
-                                       array( 'query', $this->getModuleName(), 
$row->campaign_id ),
+                                       $campaignPath,
                                        'totalContributors',
                                        $campaign->getTotalContributorsCount()
                                );

-- 
To view, visit https://gerrit.wikimedia.org/r/82865
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I937b769677dc9e38f4b4f951d2e712b45575c149
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to