r107872 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107871‎ | r107872 | r107873 >
Date:09:22, 3 January 2012
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Workaround API ugliness, it doesn't accept value foo|bar if allowed values are defined as an array. Even though we only want one parameter, it goes to explode the params at | and complain that only one is allowed.
Modified paths:
  • /trunk/extensions/Translate/api/ApiGroupReview.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/api/ApiGroupReview.php
@@ -97,7 +97,11 @@
9898 global $wgTranslateWorkflowStates;
9999 return array(
100100 'group' => array(
101 - ApiBase::PARAM_TYPE => array_keys( MessageGroups::getAllGroups() ),
 101+ /* API borks with | if defined multiple allowed values even
 102+ * though we are expecting only one value, which can and will
 103+ * contain | for page translation pages, which have group id
 104+ * of format page|Pagename. */
 105+ ApiBase::PARAM_TYPE => 'string',//array_keys( MessageGroups::getAllGroups() ),
102106 ApiBase::PARAM_REQUIRED => true,
103107 ),
104108 'language' => array(

Comments

#Comment by Johnduhart (talk | contribs)   16:30, 5 January 2012

Is this still needed Niklas?

#Comment by Nikerabbit (talk | contribs)   16:44, 5 January 2012

As long as I need to support 1.19 still, yes. I added a comment clarifying that in later rev.

#Comment by Johnduhart (talk | contribs)   20:19, 5 January 2012

I'll assume you mean 1.18.

#Comment by Nikerabbit (talk | contribs)   21:01, 5 January 2012

Yes, I noted that to you on IRC.

Status & tagging log