Page MenuHomePhabricator

EntityIdHtmlLinkFormatter should account for foreign entities
Closed, ResolvedPublic

Description

Once a property from the foreign repository is used in the statement, its ID is displayed instead of the label, and "Deleted property" note is added. See screen cap below.

federation-foreign-property-as-deleted.png (398×481 px, 21 KB)

Formatter's logic should be adjusted to account for foreign entities.

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenFeatureNone
OpenFeatureNone
DuplicateNone
ResolvedNone
ResolvedNone
ResolvedNone
OpenNone
OpenNone
StalledNone
ResolvedLydia_Pintscher
ResolvedLydia_Pintscher
ResolvedLydia_Pintscher
ResolvedWMDE-leszek
ResolvedWMDE-leszek
ResolvedWMDE-leszek
ResolvedWMDE-leszek

Event Timeline

After some code-spelunking with @WMDE-leszek, we found that the issue here is two-fold:

  1. the EntityIdHtmlLinkFormatter needs to get the correct LabelDescriptionLookup - one that can handle multiple repositories. FormatterLabelDescriptionLookupFactory is responsible for providing this instance. In an EntityView, this will be based on an EntityInfoTermLookup, which leads to the problem of creating an EntityInfoBuilder that can handle federation. I filed T157363 for this.
  2. EntityIdHtmlLinkFormatter needs to correctly handle the fact that a) TitleLookup::getTitleForId may return null, and b) Title::exists() returns false for interwiki titles. So, the existance check should be skipped if the title is not local, and getTitleForId returning null should be treated as if the entity was missing (as if exists() returned false).

Change 336240 had a related patch set uploaded (by WMDE-leszek):
EntityIdHtmlLinkFormatter: do not check existence of non-local titles

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

Change 336240 merged by jenkins-bot:
EntityIdHtmlLinkFormatter: do not check existence of non-local titles

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

WMDE-leszek claimed this task.
WMDE-leszek moved this task from Monitoring to Done on the Wikidata-Former-Sprint-Board board.