Anomie has uploaded a new change for review.

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

Change subject: Update ApiResult handling for mediawiki/core change I7b37295e
......................................................................

Update ApiResult handling for mediawiki/core change I7b37295e

Change I7b37295e for mediawiki/core deprecates several methods, and more
importantly changes the format of the data returned from
ApiResult::getData(). This change should handle these differences in a
backwards-compatible manner.

Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678d
---
M api/ApiPush.php
M includes/Push_Tab.php
2 files changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Push 
refs/changes/95/183595/1

diff --git a/api/ApiPush.php b/api/ApiPush.php
index 4783b85..82a5377 100644
--- a/api/ApiPush.php
+++ b/api/ApiPush.php
@@ -193,7 +193,14 @@
 
                $api = new ApiMain( new FauxRequest( $requestData, true ), true 
);
                $api->execute();
-               $response = $api->getResultData();
+               if ( defined( 'ApiResult::META_CONTENT' ) ) {
+                       $response = $api->getResult()->getResultData();
+                       $response = ApiResult::transformForBC( $response );
+                       $response = ApiResult::transformForTypes( $response, 
array( 'BC' => true ) );
+                       $response = ApiResult::removeMetadata( $response );
+               } else {
+                       $response = $api->getResultData();
+               }
 
                $revision = false;
 
diff --git a/includes/Push_Tab.php b/includes/Push_Tab.php
index 71eef59..7187e67 100644
--- a/includes/Push_Tab.php
+++ b/includes/Push_Tab.php
@@ -419,7 +419,11 @@
                
                $api = new ApiMain( new FauxRequest( $requestData, true ), true 
);
                $api->execute();
-               $response = $api->getResultData();
+               if ( defined( 'ApiResult::META_CONTENT' ) ) {
+                       $response = ApiResult::removeMetadata( 
$api->getResult()->getResultData() );
+               } else {
+                       $response = $api->getResultData();
+               }
 
                if ( is_array( $response ) && array_key_exists( 'query', 
$response ) && array_key_exists( 'pages', $response['query'] ) ) {
                        foreach ( $response['query']['pages'] as $page ) {
@@ -438,4 +442,4 @@
                return array_unique( $images );
        }
        
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Push
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

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

Reply via email to