Page MenuHomePhabricator

"Exception Caught: Language not set" with messagegroupstats WebAPI query and dynamic group
Closed, ResolvedPublic

Description

Calling action=query&meta=messagegroupstats with a dynamic group, e.g. URL, produces:

{

"error": {
    "code": "internal_api_error_MWException",
    "info": "Exception Caught: Language not set",
    "*": "\n\n#0 /www/translatewiki.net/w/extensions/Translate/messagegroups/MessageGroupOld.php(300): RecentMessageGroup->getDefinitions()\n#1 /www/translatewiki.net/w/extensions/Translate/utils/MessageGroupStats.php(374): MessageGroupOld->initCollection('aa')\n#2 /www/translatewiki.net/w/extensions/Translate/utils/MessageGroupStats.php(327): MessageGroupStats::calculateGroup(Object(RecentAdditionsMessageGroup), 'aa')\n#3 /www/translatewiki.net/w/extensions/Translate/utils/MessageGroupStats.php(265): MessageGroupStats::forItemInternal(Array, Object(RecentAdditionsMessageGroup), 'aa')\n#4 /www/translatewiki.net/w/extensions/Translate/utils/MessageGroupStats.php(114): MessageGroupStats::forGroupInternal(Object(RecentAdditionsMessageGroup))\n#5 /www/translatewiki.net/w/extensions/Translate/api/ApiQueryMessageGroupStats.php(29): MessageGroupStats::forGroup('!additions')\n#6 /www/translatewiki.net/w/extensions/Translate/api/ApiStatsQuery.php(25): ApiQueryMessageGroupStats->getData()\n#7 /www/translatewiki.net/w/includes/api/ApiQuery.php(273): ApiStatsQuery->execute()\n#8 /www/translatewiki.net/w/includes/api/ApiMain.php(840): ApiQuery->execute()\n#9 /www/translatewiki.net/w/includes/api/ApiMain.php(380): ApiMain->executeAction()\n#10 /www/translatewiki.net/w/includes/api/ApiMain.php(351): ApiMain->executeActionWithErrorHandling()\n#11 /www/translatewiki.net/w/api.php(73): ApiMain->execute()\n#12 {main}\n\n"
}

}

Expected: stats for the messages contained in the group for each language (at least for !additions) are produced, or a meaningful error message is provided.

Note that !additions and !recent are not allowed as input in the special page (which just ignores them).


Version: master
Severity: normal
URL: http://translatewiki.net/w/api.php?action=query&meta=messagegroupstats&mgsgroup=!additions&format=jsonfm

Details

Reference
bz51761

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:55 AM
bzimport set Reference to bz51761.
Nemo_bis created this task.Jul 20 2013, 9:07 PM

Change 74944 had a related patch set uploaded by Nikerabbit:
Check and disallowe dynamic groups in ApiQueryMessageGroupStats

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

Change 74944 merged by jenkins-bot:
Check and disallow dynamic groups in ApiQueryMessageGroupStats

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