Mattflaschen has uploaded a new change for review.

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

Change subject: Fix metadataonly parameter and use it in JS
......................................................................

Fix metadataonly parameter and use it in JS

Without declaring it as boolean, getParameter would not return a
boolean.

We don't really need to detect if it's omitted.  Omitted and
explicitly false will both cause a backwards-compatibility problem,
so use an appropriate message that covers both.

Use this in JS so until we get the benefits before deprecating it.

Bug: T98534
Change-Id: I97e194e2e1ed0ec5a115a847119fd3d8e7e6bbde
---
M includes/Api/ApiFlowBasePost.php
M modules/engine/misc/flow-api.js
2 files changed, 15 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/78/209678/1

diff --git a/includes/Api/ApiFlowBasePost.php b/includes/Api/ApiFlowBasePost.php
index 5b5e1f7..15e48b2 100644
--- a/includes/Api/ApiFlowBasePost.php
+++ b/includes/Api/ApiFlowBasePost.php
@@ -64,13 +64,13 @@
                                $output[$action]['result'][$block->getName()] = 
$block->renderApi( $params[$block->getName()] );
                        }
 
-                       if ( $this->getParameter( 'metadataonly' ) === null ) {
-                               $this->setWarning(
-                                       'This API will soon stop providing 
detailed render data in ' .
-                                       'flow.[action].result. Start getting 
that data from view-*' .
-                                       'API submodules.'
-                               );
-                       }
+                       $this->setWarning(
+                               'The API will soon stop providing detailed 
render data in ' .
+                               'flow.[action].result. The metadataonly option 
will be ' .
+                               'removed, and the API will always only provide 
metadata. ' .
+                               'It will behave as it currently does when 
metadataonly is true. ' .
+                               'Start getting render data from view-* API 
submodules.'
+                       );
                }
 
                // required until php5.4 which has the JsonSerializable 
interface
@@ -93,8 +93,8 @@
                                // going to deprecate this (it's becoming 
default behavior) and
                                // I want to warn people who DON'T set this 
param, so I don't
                                // want it to default to anything (so I can 
check for null)
-                               // ApiBase::PARAM_TYPE => 'boolean',
-                               // ApiBase::PARAM_DFLT => false,
+                               ApiBase::PARAM_TYPE => 'boolean',
+                               ApiBase::PARAM_DFLT => false,
                                ApiBase::PARAM_REQUIRED => false,
                        ),
                );
diff --git a/modules/engine/misc/flow-api.js b/modules/engine/misc/flow-api.js
index 02c4c0b..fab74a4 100644
--- a/modules/engine/misc/flow-api.js
+++ b/modules/engine/misc/flow-api.js
@@ -230,6 +230,12 @@
 
                // Use the default submodule if no action in URL
                queryMap.submodule = queryMap.submodule || 
this.defaultSubmodule;
+
+               // We will do a separate view request afterwards, so we don't 
want view data
+               // to be returned from POST.
+               // Can be removed when 
Iddd999536d1c37eedf5c61938e0c2b2f4bc66827 is merged.
+               queryMap[apiTransformMap[queryMap.submodule][0] + 
'metadataonly'] = true;
+
                // Default action is flow
                queryMap.action = queryMap.action || 'flow';
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I97e194e2e1ed0ec5a115a847119fd3d8e7e6bbde
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

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

Reply via email to