Lucas_Werkmeister_WMDE claimed this task.
Lucas_Werkmeister_WMDE edited projects, added Special:NewLexeme revival 
(Special:NewLexeme revival - sprint 11); removed Special:NewLexeme revival.
Lucas_Werkmeister_WMDE added a comment.


  I looked into this a bit, and I think it’s an unfortunate effect of some 
confusing class functionality in Wikibase. There are two relevant 
`FallbackLabelDescriptionLookup` implementations: 
`LanguageFallbackLabelDescriptionLookup`, which looks up labels and 
descriptions using an inner `TermLookup` while applying language fallbacks, and 
`CachingFallbackLabelDescriptionLookup`, which wraps another 
`FallbackLabelDescriptionLookup` and adds caching to it.
  
  One thing `CachingFallbackLabelDescriptionLookup` does that isn’t exactly 
obvious from its name is that it also resolves redirects. The code to do this 
(based on `EntityRevisionLookup`) used to be directly in the class, until it 
was extracted into a separate RedirectResolvingLatestRevisionLookup class 
<https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/567020> for 
T196882 <https://phabricator.wikimedia.org/T196882>.
  
  Both of these `FallbackLabelDescriptionLookup` implementations are 
instantiated in various places. Some places wrap a 
`CachingFallbackLabelDescriptionLookup` around a 
`LanguageFallbackLabelDescriptionLookup`, others return a 
`LanguageFallbackLabelDescriptionLookup` directly. Because only 
`CachingFallbackLabelDescriptionLookup` resolves redirects, this means that 
only the former places will show the labels of redirect targets – more or less 
arbitrarily, I think.
  
  Places that create a wrapping `CachingFallbackLabelDescriptionLookup` (good):
  
  - `FormatterLabelDescriptionLookupFactory`, used to format entity ID values 
(I think)
  - `WikibaseValueFormatterBuilders` likewise(?)
  
  Places that directly return a `LanguageFallbackLabelDescriptionLookup` (bad):
  
  - `LanguageFallbackLabelDescriptionLookupFactory` (I suppose that’s to be 
expected), which in turn is used in //many// places
  - `WikibaseLexeme.datatypes.php` `PT:wikibase-lexeme` 
`formatter-factory-callback` (has a TODO to use 
`LanguageFallbackLabelDescriptionLookupFactory` which wouldn’t really help at 
the moment, per above), used to format the language and lexical category in the 
tooltip (`title`) of Lexeme values (I think)
    - (the `PT:wikibase-form` `formatter-factory-callback` uses 
`LanguageFallbackLabelDescriptionLookupFactory`, though)
  - `WikibaseRepo.entitytypes.php` `item` 
`ENTITY_ID_HTML_LINK_FORMATTER_CALLBACK` – I **think** this is the one that’s 
actually used by `LexemeView` to render the language and lexical category
  - `WikibaseLexeme.entitytypes.repo.php` `lexeme` (and `form`) 
`ENTITY_ID_HTML_LINK_FORMATTER_CALLBACK`
  - `WikibaseClient.ServiceWiring` `SidebarLinkBadgeDisplay`, probably unrelated
  
  I don’t know if there’s actually any good reason why these shouldn’t use 
`CachingFallbackLabelDescriptionLookup` as well.

TASK DETAIL
  https://phabricator.wikimedia.org/T305032

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Lydia_Pintscher, Astuthiodit_1, karapayneWMDE, 
Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, Gq86, 
GoranSMilovanovic, Mahir256, QZanden, LawExplorer, _jensen, rosalieper, 
Bodhisattwa, Scott_WUaS, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to