Tarrow added a comment.
I think the main place this is used and causes problems is: T247057 <https://phabricator.wikimedia.org/T247057> You can see that what happens is that the CachingFallbackLabelDescriptionLookup is always looking up whatever is at the top of the LanguageFallbackChain (see: for example \Wikibase\Lib\Store\CachingFallbackLabelDescriptionLookup::getDescription) This is a problem because in \Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLanguageFallbackChain the chain is built from a Language that is not guaranteed to be a Term language (it can either be the contentLanguage or the user language). ( See: \Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLanguage ) The same problem may well be true in the other place it is used in Wikibase: \Wikibase\Lib\Formatters\WikibaseValueFormatterBuilders::newItemPropertyIdHtmlLinkFormatter where it is built from a language fallback chain from FormatterOptions (which is obviously custom to the caller in the datatypes callbacks) This brings to mind a handful of solutions: - Augment the CachingFallbackLabelDescriptionLookup so that it only tries to work with valid terms. The challenges related to this are: - Having to awkwardly inject the valid Terms ContentLanguages object - Having to inject some 'default' Language in the event that none of the languages in the provided FallbackChain are valid Term Languages - Ensure that only valid Term Languages are used to create the CachingFallbackLabelDescriptionLookup. This has the challenge that: - The ItemPropertyIdHtmlLinkFormatter is built using a FallbackChain provided by FormatterOptions which other people can hook into - Remove CachingFallbackLabelDescriptionLookup and: - Create a new LabelDescriptionLookup e.g. using something like CachingPrefetchingTermLookup inside and swap OR - Remove ItemPropertyIdHtmlLinkFormatter (replace with LabelsProviderEntityIdHtmlLinkFormatter?) AND refactor \Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageDependentLuaBindings to use an alternative method for LabelDescription Lookups TASK DETAIL https://phabricator.wikimedia.org/T250930 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Michael, Tarrow Cc: Tarrow, WMDE-leszek, Addshore, Aklapper, Iflorez, darthmon_wmde, alaa_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
