Page MenuHomePhabricator

`action=query&meta=messagegroupstats` api fails, saying "mgsgroup" must be set when it is
Closed, ResolvedPublic

Description

Steps to reproduce:

Actual result:

{
    "error": {
        "code": "nomgsgroup",
        "info": "The \"mgsgroup\" parameter must be set.",
        "*": "See https://meta.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw1231"
}

Expected result

  • The mgsgroup parameter passed in the query is understood

I'll note that the source specifies that apierror-missingparam is thrown when MessageGroups::getGroup( $params['group'] ) evaluates to false - maybe a different error should be returned

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The same issue arises at https://meta.wikimedia.org/w/api.php?action=query&list=messagecollection&mcgroup=page-Example

I suggest that apierror-badparameter be thrown instead, since the issue isn't that the parameter wasn't set, but that it wasn't valid. This would be for all translate APIs where this is an issue. Since the parameters are listed as required, that restriction is still enforced by the Api base

Nikerabbit added a subscriber: Nikerabbit.

This looks like to be the case of using confusing error code, but no issue in functionality.

Change 530715 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Translate@master] Fix api error messages when bad parameters are passed.

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

Change 530715 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix api error messages when bad parameters are passed.

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

Mentioned in SAL (#wikimedia-releng) [2019-12-29T20:18:41Z] <hauskatze> github: Mirror deleted: "wikimedia/analytics-limn-flow-data" (T229981)

Mentioned in SAL (#wikimedia-releng) [2019-12-29T20:18:41Z] <hauskatze> github: Mirror deleted: "wikimedia/analytics-limn-flow-data" (T229981)

Please disregard. I entered the wrong ticket number while logging.