Page MenuHomePhabricator

Fix "mul" language code handling
Closed, ResolvedPublic5 Estimated Story Points

Description

"mul" is a valid language code for labels and aliases, but not for descriptions. We're currently using WikibaseRepo::getTermsLanguages( $services )->getLanguages() for both, which can't be right.

We should change our code so that there is no generic LanguageCodeValidator, because whether a language code is valid or not depends on what it is being used for.

Event Timeline

Task breakdown notes:

  • create one interface for each labels, descriptions and aliases, but reuse the same (existing) implementation
  • create one service wiring entry for each
  • use the new validators in all deserializers
  • use the new validators in all RequestValidatingDeserializers
    • split LanguageCodeRequest into three accordingly
  • this may not be enabled in CI yet so creating an e2e test (that passes in CI) might not be straightforward. Talk to the WD team :)
  • setting name: tmpEnableMulLanguageCode
  • getDefaultTermsLanguages returns mul if it is configured which is confusing since it's not valid for all kinds of terms. It would be nice to have this cleaned up in the rest of Wikibase as well. We should talk to the WD team about it or at least make sure there is a ticket.

Change #1043700 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Use term type specific validators

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

Change #1043767 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Add "mul" language code handling e2e tests

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

Change #1047048 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Use term type specific path param validators

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

Change #1043700 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Use term type specific validators

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

Change #1043767 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Add "mul" language code handling e2e tests

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

Change #1047102 had a related patch set uploaded (by Ollie Shotton; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Use term type specific path param validators

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

Change #1047102 abandoned by Ollie Shotton:

[mediawiki/extensions/Wikibase@master] REST: Use term type specific path param validators

Reason:

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

Change #1047048 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Use term type specific path param validators

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