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

Change subject: Remove pre-1.25 API compatibility code
......................................................................


Remove pre-1.25 API compatibility code

Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: Iff2eeb2bbfba15c84a4fcec85b6647c28886e9aa
---
M ApiVisualEditor.php
M ApiVisualEditorEdit.php
2 files changed, 15 insertions(+), 35 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index cc73e43..1e047b5 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -212,14 +212,10 @@
                        false // enable write?
                );
                $api->execute();
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $result = $api->getResult()->getResultData( null, [
-                               'BC' => [], // Transform content nodes to '*'
-                               'Types' => [], // Add back-compat subelements
-                       ] );
-               } else {
-                       $result = $api->getResultData();
-               }
+               $result = $api->getResult()->getResultData( null, [
+                       'BC' => [], // Transform content nodes to '*'
+                       'Types' => [], // Add back-compat subelements
+               ] );
                if ( !isset( 
$result['query']['pages'][$title->getArticleID()]['revisions'][0]['diff']['*'] 
) ) {
                        return [ 'result' => 'fail' ];
                }
@@ -260,15 +256,11 @@
                );
 
                $api->execute();
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $result = $api->getResult()->getResultData( null, [
-                               'BC' => [], // Backwards-compatible structure 
transformations
-                               'Types' => [], // Backwards-compatible 
structure transformations
-                               'Strip' => 'all', // Remove any metadata keys 
from the langlinks array
-                       ] );
-               } else {
-                       $result = $api->getResultData();
-               }
+               $result = $api->getResult()->getResultData( null, [
+                       'BC' => [], // Backwards-compatible structure 
transformations
+                       'Types' => [], // Backwards-compatible structure 
transformations
+                       'Strip' => 'all', // Remove any metadata keys from the 
langlinks array
+               ] );
                if ( !isset( 
$result['query']['pages'][$title->getArticleID()]['langlinks'] ) ) {
                        return false;
                }
diff --git a/ApiVisualEditorEdit.php b/ApiVisualEditorEdit.php
index bad751f..01cdb7a 100644
--- a/ApiVisualEditorEdit.php
+++ b/ApiVisualEditorEdit.php
@@ -53,11 +53,7 @@
 
                $api->execute();
 
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       return $api->getResult()->getResultData();
-               } else {
-                       return $api->getResultData();
-               }
+               return $api->getResult()->getResultData();
        }
 
        protected function parseWikitext( $title, $newRevId ) {
@@ -77,15 +73,11 @@
                );
 
                $api->execute();
-               if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                       $result = $api->getResult()->getResultData( null, [
-                               'BC' => [], // Transform content nodes to '*'
-                               'Types' => [], // Add back-compat subelements
-                               'Strip' => 'all', // Remove any metadata keys 
from the links array
-                       ] );
-               } else {
-                       $result = $api->getResultData();
-               }
+               $result = $api->getResult()->getResultData( null, [
+                       'BC' => [], // Transform content nodes to '*'
+                       'Types' => [], // Add back-compat subelements
+                       'Strip' => 'all', // Remove any metadata keys from the 
links array
+               ] );
                $content = isset( $result['parse']['text']['*'] ) ? 
$result['parse']['text']['*'] : false;
                $categorieshtml = isset( 
$result['parse']['categorieshtml']['*'] ) ?
                        $result['parse']['categorieshtml']['*'] : false;
@@ -278,10 +270,6 @@
 
        public function needsToken() {
                return 'csrf';
-       }
-
-       public function getTokenSalt() {
-               return '';
        }
 
        public function mustBePosted() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff2eeb2bbfba15c84a4fcec85b6647c28886e9aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to