Yaron Koren has uploaded a new change for review.

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

Change subject: Fixed hardcoding of MW API URL
......................................................................

Fixed hardcoding of MW API URL

Change-Id: I4fb26aadbe17a0ac63d1a6f0cd5fc710824f260d
---
M specials/CargoRecreateData.php
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/26/205526/1

diff --git a/specials/CargoRecreateData.php b/specials/CargoRecreateData.php
index 5e852c5..2fb22e4 100644
--- a/specials/CargoRecreateData.php
+++ b/specials/CargoRecreateData.php
@@ -20,7 +20,7 @@
        }
 
        function execute( $query = null ) {
-               global $cgScriptPath;
+               global $wgScriptPath, $cgScriptPath;
 
                $out = $this->getOutput();
 
@@ -69,12 +69,15 @@
                        }
                }
 
+               // Is this the best way to get the API URL?
+               $apiURL = $wgScriptPath . "/api.php";
                $templateDataJS = json_encode( $templateData );
                $recreateTableDoneMsg = wfMessage( 
'cargo-recreatedata-tablecreated', $this->mTableName )->text();
                $recreateDataDoneMsg = wfMessage( 'cargo-recreatedata-success' 
)->text();
 
                $jsText = <<<END
 <script type="text/javascript">
+var apiURL = "$apiURL";
 var cargoScriptPath = "$cgScriptPath";
 var tableName = "{$this->mTableName}";
 var templateData = $templateDataJS;
@@ -118,7 +121,7 @@
                queryStringData['replaceOldRows'] = true;
        }
        $.get(
-               "/w/api.php",
+               apiURL,
                queryStringData
        )
        .done(function( msg ) {
@@ -147,7 +150,7 @@
        var templateName = templateData[0]['name'];
        $("#recreateTableProgress").html( "<img src=\"" + cargoScriptPath + 
"/skins/loading.gif\" />" );
        $.get(
-               "/w/api.php",
+               apiURL,
                { action: "cargorecreatetables", template: templateName }
        )
        .done(function( msg ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fb26aadbe17a0ac63d1a6f0cd5fc710824f260d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <yaro...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to