jenkins-bot has submitted this change and it was merged.

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: I7b37295e8862b188d1f3b0cd07f66ac34629678e
---
M includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
M includes/Handlers/UploadHandler.php
2 files changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  Dan-nl: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php 
b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
index ca83e39..21a2324 100644
--- a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
+++ b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
@@ -127,7 +127,12 @@
 
                $Api->execute();
 
-               $api_result = $Api->getResultData();
+               if ( defined( 'ApiResult::META_CONTENT' ) ) {
+                       $api_result = \ApiResult::removeMetadata( 
$Api->getResult()->getResultData() );
+               } else {
+                       $api_result = $Api->getResultData();
+               }
+
                $api_result = Utils::objectToArray( $api_result );
 
                if ( isset( $api_result['pages'] ) && count( 
$api_result['pages'] ) === 1 ) {
diff --git a/includes/Handlers/UploadHandler.php 
b/includes/Handlers/UploadHandler.php
index ecd2010..6a04864 100644
--- a/includes/Handlers/UploadHandler.php
+++ b/includes/Handlers/UploadHandler.php
@@ -568,7 +568,12 @@
 
                $Api->execute();
 
-               $api_result = $Api->getResultData();
+               if ( defined( 'ApiResult::META_CONTENT' ) ) {
+                       $api_result = \ApiResult::removeMetadata( 
$Api->getResult()->getResultData() );
+               } else {
+                       $api_result = $Api->getResultData();
+               }
+
                $api_result = Utils::objectToArray( $api_result );
 
                if (

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Dan-nl <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to