Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/210071
Change subject: Remove deprecated API params
......................................................................
Remove deprecated API params
'contentFormat' has been replaced by 'format' entirely.
'metadataonly' has just been removed - we now have read APIs for that data.
Change-Id: Iadc41fa1aa5a0ce23d8316e8430044804927bd31
---
M includes/Api/ApiFlowBaseGet.php
M includes/Api/ApiFlowBasePost.php
M includes/Api/ApiFlowViewHeader.php
M includes/Api/ApiFlowViewPost.php
M includes/Api/ApiFlowViewTopicSummary.php
M includes/Block/Topic.php
6 files changed, 0 insertions(+), 77 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/71/210071/1
diff --git a/includes/Api/ApiFlowBaseGet.php b/includes/Api/ApiFlowBaseGet.php
index 839501d..8b7651d 100644
--- a/includes/Api/ApiFlowBaseGet.php
+++ b/includes/Api/ApiFlowBaseGet.php
@@ -30,15 +30,6 @@
$blockParams =
$passedParams[$block->getName()];
}
- // @deprecated
- // BC override: to be removed once
ApiFlowViewHeader.php, ApiFlowViewPost &
- // ApiFlowViewTopicSummary.php no longer accept
'contentFormat' param
- if ( isset( $blockParams['format'] ) ) {
- // override default 'format' value by
old 'contentFormat',
- // if it was specified
- $blockParams['format'] = isset(
$blockParams['contentFormat'] ) ? $blockParams['contentFormat'] :
$blockParams['format'];
- }
-
$output[$action]['result'][$block->getName()] =
$block->renderApi( $blockParams );
}
}
diff --git a/includes/Api/ApiFlowBasePost.php b/includes/Api/ApiFlowBasePost.php
index 15e48b2..86cd994 100644
--- a/includes/Api/ApiFlowBasePost.php
+++ b/includes/Api/ApiFlowBasePost.php
@@ -52,27 +52,6 @@
'committed' => $commitMetadata,
) );
- // 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()] );
- }
-
- $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
array_walk_recursive( $output, function( &$value ) {
if ( $value instanceof Anchor ) {
@@ -85,19 +64,6 @@
} );
$this->getResult()->addValue( null,
$this->apiFlow->getModuleName(), $output );
- }
-
- public function getAllowedParams() {
- return array(
- 'metadataonly' => array(
- // 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/includes/Api/ApiFlowViewHeader.php
b/includes/Api/ApiFlowViewHeader.php
index 231beef..dfd1e08 100644
--- a/includes/Api/ApiFlowViewHeader.php
+++ b/includes/Api/ApiFlowViewHeader.php
@@ -30,10 +30,6 @@
ApiBase::PARAM_DFLT => $wgFlowContentFormat,
),
'revId' => null,
- 'contentFormat' => array(
- ApiBase::PARAM_TYPE => array( 'html',
'wikitext' ),
- ApiBase::PARAM_DEPRECATED => true
- ),
);
}
diff --git a/includes/Api/ApiFlowViewPost.php b/includes/Api/ApiFlowViewPost.php
index fe56fbc..fafa587 100644
--- a/includes/Api/ApiFlowViewPost.php
+++ b/includes/Api/ApiFlowViewPost.php
@@ -33,10 +33,6 @@
ApiBase::PARAM_TYPE => array( 'html',
'wikitext', 'fixed-html' ),
ApiBase::PARAM_DFLT => $wgFlowContentFormat,
),
- 'contentFormat' => array(
- ApiBase::PARAM_TYPE => array( 'html',
'wikitext' ),
- ApiBase::PARAM_DEPRECATED => true
- ),
);
}
diff --git a/includes/Api/ApiFlowViewTopicSummary.php
b/includes/Api/ApiFlowViewTopicSummary.php
index d41abcc..f66f0e6 100644
--- a/includes/Api/ApiFlowViewTopicSummary.php
+++ b/includes/Api/ApiFlowViewTopicSummary.php
@@ -30,10 +30,6 @@
ApiBase::PARAM_DFLT => $wgFlowContentFormat,
),
'revId' => null,
- 'contentFormat' => array(
- ApiBase::PARAM_TYPE => array( 'html',
'wikitext' ),
- ApiBase::PARAM_DEPRECATED => true
- ),
);
}
diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php
index 334ce34..1b02d8c 100644
--- a/includes/Block/Topic.php
+++ b/includes/Block/Topic.php
@@ -519,28 +519,6 @@
case 'restore-post':
case 'reply':
case 'moderate-topic':
- /*
- * @todo: below line is a hack and should be
removed when 'metadataonly' API param is removed.
- * Some history:
- * * write APIs (reply, edit-post, ...) used to
also output data needed for rendering (e.g. content)
- * * we used to have an API param 'format' to
tell us what format content is submitted in (write APIs)
- * * we used to have an API param
'contentFormat' to us ask output in a certain format (read APIs)
- * * we never properly implemented
'contentFormat' in write APIs, the output always defaulted to storage
- * format (which is HTML by default)
- * * we stopped letting write APIs output
content and renamed both input & output format param to
- 'format' for consistency
- * * ... but for B/C reasons, we're currently
in an inconsistent state where 'contentFormat' is still
- * accepted but autorenamed to 'format', and
we still let write APIs output render data
- * * we plan to get rid of both of those later:
https://gerrit.wikimedia.org/r/#/c/202346/ &
- * https://gerrit.wikimedia.org/r/#/c/203826/
- * * even though we no longer use the write API
render data, we still supply it, and because of the
- * changes/fixes to 'format', it tries to
parse all topics from html to wikitext, which slows down
- * that request
- * * this 1-line hack will force output format
to HTML, which is what we usually store content in, and
- * what we used to output content in before
we fixed up 'format' params - this should be fine until
- * we get rid of deprecated BC-compat thingies
- */
- $options['format'] = 'fixed-html';
case 'view-topic':
case 'view' && !isset( $options['postId'] ) && !isset(
$options['revId'] );
// view full topic
--
To view, visit https://gerrit.wikimedia.org/r/210071
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadc41fa1aa5a0ce23d8316e8430044804927bd31
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits