Page MenuHomePhabricator

ZObjectStore::fetchAllZLanguageCodes excludes some laguage codes when two codes are associated to one Zid
Closed, ResolvedPublicBUG REPORT

Description

Description

Observed behavior

{
    "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

Event Timeline

gengh created this task.

Change #1060907 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Fix fetchAllZLanguageCodes to not exclude some codes

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

Change #1060907 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Fix fetchAllZLanguageCodes to not exclude some codes

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