Description
Observed behavior
- Go to any wiki page with ?uselang=lv
- E.g. https://www.wikifunctions.org/wiki/Z11?uselang=lv
- Page doesn't load
- API requests to wikilambdaload_zobject return:
{ "error": { "code": "badvalue", "info": "Unrecognized value for parameter \"wikilambdaload_language\": lv.", "*": "See https://www.wikifunctions.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes." }, "servedby": "mw-wikifunctions.eqiad.main-7d9459d6d7-sv7bt" }
Details
Some Natural Language objects (Z60) have secondary (alias) language codes (Z60K2). All of them (primary and secondary) are inserted into the wikilambda_zlanguages table. This table has no information of whether a code is the main (Z60K1) or an alias one (Z60K2).
Methods and APIs that use ZObjectStore::fetchAllZLanguageObjects or ZObjectStore::fetchAllZLanguageCodes will only return one of the two codes, often the secondary/alias one, making their language main code not present.
API parameter validation use this.
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Back-end_Task/Bug_completion_checklist