When a redirected item is being used in a Statement, both the {{#property:…}} parser function and mw.wikibase.entity.formatPropertyValues don't resolve the redirect but just show the entity id.
It seems more desirable to resolve redirects there and use the label of the redirect target if possible… also that's consistent with how the repo UI works.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Show redirect target label on formatted entity values | mediawiki/extensions/Wikibase | master | +98 -16 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Invalid | None | T112073 Lua in Wikibase (tracking) | |||
Resolved | Jakob_WMDE | T127169 The property parser function and mw.wikibase.entity.formatPropertyValues should resolve item redirects when formatting Snak values | |||
Resolved | Jakob_WMDE | T142950 Implement an item redirect resolving TermLookup | |||
Resolved | Addshore | T112658 [Task] WikiPageEntityRevisionLookup::getLatestRevisionId() should throw an UnsersolvedRedirectException when encountering a redirect. | |||
Resolved | Ladsgroup | T192462 mw.wikibase.entityExists returns false for redirected entities |
Event Timeline
This seems partially redundant with T157868, however I am not sure about mw.wikibase.entity.formatPropertyValues. I agree that Wikibase parser functions like {{#property:…}} should probably properly redirect, however, from Scribunto I would rather see mw.wikibase.getEntity and add a mw.wikibase.resolveEntityId implemented or perhaps also have mw.wikibase.getAllStatements and mw.wikibase.getBestStatements redirect.
If mw.wikibase.getEntity, mw.wikibase.getAllStatements and mw.wikibase.getBestStatements redirect one can at least determine which entity ID is the redirection target via returned "id" field.
This did not get fixed by what was done for T157868 so far. On my local wiki, Q6 is a redirect:
= mw.wikibase.getLabel('Q6') hello mw.logObject(mw.wikibase.getEntity('Q2'):formatPropertyValues('P38')) table#1 { ["label"] = "wikibase-item property", ["value"] = "Q6", }
The parser function does not resolve redirects either.
Change 684431 had a related patch set uploaded (by Jakob; author: Jakob):
[mediawiki/extensions/Wikibase@master] Show redirect target label on formatted entity values
Change 684431 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Show redirect target label on formatted entity values