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

Change subject: Get rid of metadataonly
......................................................................


Get rid of metadataonly

It was a hack because our JS needed more details to render.
We don't need that anymore, though, all required data will
be fetched from one of the read APIs.

Deprecation is a bit awkward here: the thing we want to
deprecate is the current default behavior - those using the
hacky param don't have to change a thing.
For a while, we'll still be spitting out all render info &
a warning message, before we get rid of it entirely.

Change-Id: I514c67adb475d64cd199047b6f434704e55e6156
---
M i18n/en.json
M i18n/qqq.json
M includes/Api/ApiFlowBasePost.php
M modules/messagePoster/ext.flow.messagePoster.js
4 files changed, 20 insertions(+), 26 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 81f2d6c..a8dc9f8 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -426,53 +426,44 @@
        "apihelp-flow+edit-header-param-content": "Content for header.",
        "apihelp-flow+edit-header-param-format": "Format of the header 
(wikitext|html)",
        "apihelp-flow+edit-header-example-1": "Edit the header of 
[[Talk:Sandbox]]",
-       "apihelp-flow+edit-header-param-metadataonly": "Whether to include only 
metadata about the new content, excluding everything else",
        "apihelp-flow+edit-post-description": "Edits a post's content.",
        "apihelp-flow+edit-post-param-postId": "Post ID.",
        "apihelp-flow+edit-post-param-prev_revision": "Revision ID of the 
current post revision, to check for edit conflicts.",
        "apihelp-flow+edit-post-param-content": "Content for post.",
        "apihelp-flow+edit-post-param-format": "Format of the post content 
(wikitext|html)",
        "apihelp-flow+edit-post-example-1": "Edit a post in 
[[Topic:S2tycnas4hcucw8w]]",
-       "apihelp-flow+edit-post-param-metadataonly": "Whether to include only 
metadata about the new content, excluding everything else",
        "apihelp-flow+edit-title-description": "Edits a topic's title.",
        "apihelp-flow+edit-title-param-prev_revision": "Revision ID of the 
current title revision, to check for edit conflicts.",
        "apihelp-flow+edit-title-param-content": "Content for title.",
        "apihelp-flow+edit-title-example-1": "Edit the title of 
[[Topic:S2tycnas4hcucw8w]]",
-       "apihelp-flow+edit-title-param-metadataonly": "Whether to include only 
metadata about the new content, excluding everything else",
        "apihelp-flow+edit-topic-summary-description": "Edits a topic summary's 
content.",
        "apihelp-flow+edit-topic-summary-param-prev_revision": "Revision ID of 
the current topic summary revision, if any, to check for edit conflicts.",
        "apihelp-flow+edit-topic-summary-param-summary": "Content for the 
summary.",
        "apihelp-flow+edit-topic-summary-param-format": "Format of the summary 
(wikitext|html)",
        "apihelp-flow+edit-topic-summary-example-1": "Edit the summary of 
[[Topic:S2tycnas4hcucw8w]]",
-       "apihelp-flow+edit-topic-summary-param-metadataonly": "Whether to 
include only metadata about the new content, excluding everything else",
        "apihelp-flow+lock-topic-description": "Lock or unlock a Flow topic.",
        "apihelp-flow+lock-topic-param-moderationState": "State to put topic 
in, either locked or unlocked.",
        "apihelp-flow+lock-topic-param-reason": "Reason for locking or 
unlocking the topic.",
        "apihelp-flow+lock-topic-example-1": "Lock [[Topic:S2tycnas4hcucw8w]]",
-       "apihelp-flow+lock-topic-param-metadataonly": "Whether to include only 
metadata about the new content, excluding everything else",
        "apihelp-flow+moderate-post-description": "Moderates a Flow post.",
        "apihelp-flow+moderate-post-param-moderationState": "What level to 
moderate at.",
        "apihelp-flow+moderate-post-param-reason": "Reason for moderation.",
        "apihelp-flow+moderate-post-param-postId": "ID of the post to 
moderate.",
        "apihelp-flow+moderate-post-example-1": "Delete a post on topic 
[[Topic:S2tycnas4hcucw8w]]",
-       "apihelp-flow+moderate-post-param-metadataonly": "Whether to include 
only metadata about the new content, excluding everything else",
        "apihelp-flow+moderate-topic-description": "Moderates a Flow topic.",
        "apihelp-flow+moderate-topic-param-moderationState": "What level to 
moderate at.",
        "apihelp-flow+moderate-topic-param-reason": "Reason for moderation.",
        "apihelp-flow+moderate-topic-example-1": "Delete the topic 
[[Topic:S2tycnas4hcucw8w]]",
-       "apihelp-flow+moderate-topic-param-metadataonly": "Whether to include 
only metadata about the new content, excluding everything else",
        "apihelp-flow+new-topic-description": "Creates a new Flow topic on the 
given workflow.",
        "apihelp-flow+new-topic-param-topic": "Text for new topic title.",
        "apihelp-flow+new-topic-param-content": "Content for the topic's 
initial reply.",
        "apihelp-flow+new-topic-param-format": "Format of the new topic's 
initial reply (wikitext|html)",
        "apihelp-flow+new-topic-example-1": "Create a new topic on 
[[Talk:Sandbox]]",
-       "apihelp-flow+new-topic-param-metadataonly": "Whether to include only 
metadata about the new content, excluding everything else",
        "apihelp-flow+reply-description": "Replies to a post.",
        "apihelp-flow+reply-param-replyTo": "Post ID to reply to.",
        "apihelp-flow+reply-param-content": "Content for new post.",
        "apihelp-flow+reply-param-format": "Format of the new post 
(wikitext|html)",
        "apihelp-flow+reply-example-1": "Reply to a post on 
[[Topic:S2tycnas4hcucw8w]]",
-       "apihelp-flow+reply-param-metadataonly": "Whether to include only 
metadata about the new content, excluding everything else",
        "apihelp-flow+view-header-description": "View a board header.",
        "apihelp-flow+view-header-param-format": "Format to return the content 
in.",
        "apihelp-flow+view-header-param-revId": "Load this revision, instead of 
the most recent.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index e0477ff..2b6553d 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -431,53 +431,44 @@
        "apihelp-flow+edit-header-param-content": 
"{{doc-apihelp-param|flow+edit-header|content}}",
        "apihelp-flow+edit-header-param-format": 
"{{doc-apihelp-param|flow+edit-header|format}}",
        "apihelp-flow+edit-header-example-1": 
"{{doc-apihelp-example|flow+edit-header}}",
-       "apihelp-flow+edit-header-param-metadataonly": 
"{{doc-apihelp-param|flow+edit-header|metadataonly}}",
        "apihelp-flow+edit-post-description": 
"{{doc-apihelp-description|flow+edit-post}}",
        "apihelp-flow+edit-post-param-postId": 
"{{doc-apihelp-param|flow+edit-post|postId}}",
        "apihelp-flow+edit-post-param-prev_revision": 
"{{doc-apihelp-param|flow+edit-post|prev_revision}}",
        "apihelp-flow+edit-post-param-content": 
"{{doc-apihelp-param|flow+edit-post|content}}",
        "apihelp-flow+edit-post-param-format": 
"{{doc-apihelp-param|flow+edit-post|format}}",
        "apihelp-flow+edit-post-example-1": 
"{{doc-apihelp-example|flow+edit-post}}",
-       "apihelp-flow+edit-post-param-metadataonly": 
"{{doc-apihelp-param|flow+edit-post|metadataonly}}",
        "apihelp-flow+edit-title-description": 
"{{doc-apihelp-description|flow+edit-title}}",
        "apihelp-flow+edit-title-param-prev_revision": 
"{{doc-apihelp-param|flow+edit-title|prev_revision}}",
        "apihelp-flow+edit-title-param-content": 
"{{doc-apihelp-param|flow+edit-title|content}}",
        "apihelp-flow+edit-title-example-1": 
"{{doc-apihelp-example|flow+edit-title}}",
-       "apihelp-flow+edit-title-param-metadataonly": 
"{{doc-apihelp-param|flow+edit-title|metadataonly}}",
        "apihelp-flow+edit-topic-summary-description": 
"{{doc-apihelp-description|flow+edit-topic-summary}}",
        "apihelp-flow+edit-topic-summary-param-prev_revision": 
"{{doc-apihelp-param|flow+edit-topic-summary|prev_revision}}",
        "apihelp-flow+edit-topic-summary-param-summary": 
"{{doc-apihelp-param|flow+edit-topic-summary|summary}}",
        "apihelp-flow+edit-topic-summary-param-format": 
"{{doc-apihelp-param|flow+edit-topic-summary|format}}",
        "apihelp-flow+edit-topic-summary-example-1": 
"{{doc-apihelp-example|flow+edit-topic-summary}}",
-       "apihelp-flow+edit-topic-summary-param-metadataonly": 
"{{doc-apihelp-param|flow+edit-topic-summary|metadataonly}}",
        "apihelp-flow+lock-topic-description": 
"{{doc-apihelp-description|flow+lock-topic}}",
        "apihelp-flow+lock-topic-param-moderationState": 
"{{doc-apihelp-param|flow+lock-topic|moderationState}}",
        "apihelp-flow+lock-topic-param-reason": 
"{{doc-apihelp-param|flow+lock-topic|reason}}",
        "apihelp-flow+lock-topic-example-1": 
"{{doc-apihelp-example|flow+lock-topic}}",
-       "apihelp-flow+lock-topic-param-metadataonly": 
"{{doc-apihelp-param|flow+lock-topic|metadataonly}}",
        "apihelp-flow+moderate-post-description": 
"{{doc-apihelp-description|flow+moderate-post}}",
        "apihelp-flow+moderate-post-param-moderationState": 
"{{doc-apihelp-param|flow+moderate-post|moderationState}}",
        "apihelp-flow+moderate-post-param-reason": 
"{{doc-apihelp-param|flow+moderate-post|reason}}",
        "apihelp-flow+moderate-post-param-postId": 
"{{doc-apihelp-param|flow+moderate-post|postId}}",
        "apihelp-flow+moderate-post-example-1": 
"{{doc-apihelp-example|flow+moderate-post}}",
-       "apihelp-flow+moderate-post-param-metadataonly": 
"{{doc-apihelp-param|flow+moderate-post|metadataonly}}",
        "apihelp-flow+moderate-topic-description": 
"{{doc-apihelp-description|flow+moderate-topic}}",
        "apihelp-flow+moderate-topic-param-moderationState": 
"{{doc-apihelp-param|flow+moderate-topic|moderationState}}",
        "apihelp-flow+moderate-topic-param-reason": 
"{{doc-apihelp-param|flow+moderate-topic|reason}}",
        "apihelp-flow+moderate-topic-example-1": 
"{{doc-apihelp-example|flow+moderate-topic}}",
-       "apihelp-flow+moderate-topic-param-metadataonly": 
"{{doc-apihelp-param|flow+moderate-topic|metadataonly}}",
        "apihelp-flow+new-topic-description": 
"{{doc-apihelp-description|flow+new-topic}}",
        "apihelp-flow+new-topic-param-topic": 
"{{doc-apihelp-param|flow+new-topic|topic}}",
        "apihelp-flow+new-topic-param-content": 
"{{doc-apihelp-param|flow+new-topic|content}}",
        "apihelp-flow+new-topic-param-format": 
"{{doc-apihelp-param|flow+new-topic|format}}",
        "apihelp-flow+new-topic-example-1": 
"{{doc-apihelp-example|flow+new-topic}}",
-       "apihelp-flow+new-topic-param-metadataonly": 
"{{doc-apihelp-param|flow+new-topic|metadataonly}}",
        "apihelp-flow+reply-description": 
"{{doc-apihelp-description|flow+reply}}",
        "apihelp-flow+reply-param-replyTo": 
"{{doc-apihelp-param|flow+reply|replyTo}}",
        "apihelp-flow+reply-param-content": 
"{{doc-apihelp-param|flow+reply|content}}",
        "apihelp-flow+reply-param-format": 
"{{doc-apihelp-param|flow+reply|format}}",
        "apihelp-flow+reply-example-1": "{{doc-apihelp-example|flow+reply}}",
-       "apihelp-flow+reply-param-metadataonly": 
"{{doc-apihelp-param|flow+reply|metadataonly}}",
        "apihelp-flow+view-header-description": 
"{{doc-apihelp-description|flow+view-header}}",
        "apihelp-flow+view-header-param-format": 
"{{doc-apihelp-param|flow+view-header|format}}",
        "apihelp-flow+view-header-param-revId": 
"{{doc-apihelp-param|flow+view-header|revId}}",
diff --git a/includes/Api/ApiFlowBasePost.php b/includes/Api/ApiFlowBasePost.php
index 422af74..5b5e1f7 100644
--- a/includes/Api/ApiFlowBasePost.php
+++ b/includes/Api/ApiFlowBasePost.php
@@ -52,14 +52,24 @@
                        'committed' => $commitMetadata,
                ) );
 
-               // User frontends need this data, but bots do not.  When they
-               // pass metadataonly=1 we will skip this data and return a 
slimmer
-               // response in a shorter timeframe.
-               if ( !$this->getParameter( 'metadataonly' ) ) {
+               // We used to provide render data along with these POST APIs 
because we
+               // needed them to render JS. Now we have view-* API's and JS is 
using
+               // them - we don't need this hack anymore.
+               // We'll let this live on for a little while and warn users who 
were not
+               // already requesting only metadata that this is soon changing.
+               if ( $this->getParameter( 'metadataonly' ) !== true ) {
                        $output[$action]['result'] = array();
                        foreach( $blocksToCommit as $block ) {
                                // Always return parsed text to client after 
successful submission?
                                $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.'
+                               );
                        }
                }
 
@@ -80,8 +90,11 @@
        public function getAllowedParams() {
                return array(
                        'metadataonly' => array(
-                               ApiBase::PARAM_TYPE => 'boolean',
-                               ApiBase::PARAM_DFLT => false,
+                               // 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_REQUIRED => false,
                        ),
                );
diff --git a/modules/messagePoster/ext.flow.messagePoster.js 
b/modules/messagePoster/ext.flow.messagePoster.js
index 1937f1c..4b6af7a 100644
--- a/modules/messagePoster/ext.flow.messagePoster.js
+++ b/modules/messagePoster/ext.flow.messagePoster.js
@@ -40,8 +40,7 @@
                        page: this.title.getPrefixedDb(),
                        nttopic: subject,
                        ntcontent: body,
-                       ntformat: 'wikitext',
-                       ntmetadataonly: 1
+                       ntformat: 'wikitext'
                }, {
                        // IE 8 seems to have cached some POST requests without 
this
                        cache: false

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I514c67adb475d64cd199047b6f434704e55e6156
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to