Page MenuHomePhabricator

messagegroups API fails when mgformat=tree
Open, Needs TriagePublic

Description

Steps to reproduce:
Try to visit

Expected result:
Output similar to using mgformat=flat

Actual result:

{
    "error": {
        "code": "internal_api_error_Error",
        "info": "[XaLDnQpAEMUAAANRb2IAAACW] Caught exception of type Error",
        "errorclass": "Error"
    },
    "servedby": "mw1276"
}

Details

Request ID
XaLDhApAAEcAAGfOeUQAAABY
Request URL
https://www.wikidata.org/w/api.php?action=query&format=json&meta=messagegroups&mgfilter=page-User%3ADannyS712%2Fsandbox&mgformat=tree
Stack Trace
#0 /srv/mediawiki/php-1.35.0-wmf.1/includes/api/ApiQuery.php(255): ApiQueryMessageGroups->execute()
#1 /srv/mediawiki/php-1.35.0-wmf.1/includes/api/ApiMain.php(1588): ApiQuery->execute()
#2 /srv/mediawiki/php-1.35.0-wmf.1/includes/api/ApiMain.php(537): ApiMain->executeAction()
#3 /srv/mediawiki/php-1.35.0-wmf.1/includes/api/ApiMain.php(508): ApiMain->executeActionWithErrorHandling()
#4 /srv/mediawiki/php-1.35.0-wmf.1/api.php(83): ApiMain->execute()
#5 /srv/mediawiki/w/api.php(3): require(string)
#6 {main}
Related Gerrit Patches:
mediawiki/extensions/Translate : masterUnbreak meta=messagegroups with mgformat=tree

Event Timeline

Restricted Application added a project: User-DannyS712. · View Herald TranscriptOct 13 2019, 6:29 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyS712 moved this task from Unsorted to Reports on the User-DannyS712 board.

That's a weird stacktrace... anyway the relevant details are:

/srv/mediawiki/php-1.35.0-wmf.1/extensions/Translate/api/ApiQueryMessageGroups.php:90
Call to a member function getId() on array

That is https://gerrit.wikimedia.org/g/mediawiki/extensions/Translate/+/38b0845ec2cb0668fcdcdd1fde1c45097e928c57/api/ApiQueryMessageGroups.php#90

Only happens when mgfilter is used. Workaround is to not use tree format when using mgfilter.

Change 554616 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/Translate@master] Unbreak meta=messagegroups with mgformat=tree

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