Robert Vogel 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: I7b37295e8862b188d1f3b0cd07f66ac34629678d
---
M includes/api/ApiFormatJsonMW.php
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved



diff --git a/includes/api/ApiFormatJsonMW.php b/includes/api/ApiFormatJsonMW.php
index 89f7151..d087043 100644
--- a/includes/api/ApiFormatJsonMW.php
+++ b/includes/api/ApiFormatJsonMW.php
@@ -36,10 +36,19 @@
                        $prefix = preg_replace( "/[^][.\\'\\\"_A-Za-z0-9]/", 
'', $callback ) . '(';
                        $suffix = ')';
                }
+
+               if ( defined( 'ApiResult::META_CONTENT' ) ) {
+                       $data = $this->getResult()->getResultData();
+                       $data = ApiResult::transformForBC( $data );
+                       $data = ApiResult::transformForTypes( $data, array( 
'BC' => true ) );
+                       $data = ApiResult::removeMetadata( $data );
+               } else {
+                       $data = $this->getResultData();
+               }
  
                $this->printText(
                        $prefix .
-                       FormatJson::encode( $this->getResultData(), 
$this->getIsHtml() ) .
+                       FormatJson::encode( $data, $this->getIsHtml() ) .
                        $suffix
                );
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pigpen <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to