Page MenuHomePhabricator

[Bug] Various functions in EntityRenderer can't handle "labelRenderer" returning nil
Closed, ResolvedPublic

Description

The labelRenderer function as used in EntityRenderer can also return nil, the functions calling need to handle that. Also it should be documented.

Example errors:
Lua error in EntityRenderer.lua at line 148: attempt to concatenate a nil value.
Lua error in EntityRenderer.lua at line 67: attempt to concatenate a nil value.

Related Objects

Event Timeline

hoo assigned this task to Lucie.
hoo raised the priority of this task from to High.
hoo updated the task description. (Show Details)
hoo added a project: ArticlePlaceholder.
hoo subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Lydia_Pintscher renamed this task from Various functions in EntityRenderer can't handle "labelRenderer" returning nil to [Bug] Various functions in EntityRenderer can't handle "labelRenderer" returning nil.Nov 16 2015, 11:42 AM
Lydia_Pintscher set Security to None.
Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.

We will have to decide first, what should happen if there is no label in the language.
For the labelRenderer mw.wikibase.label is used. It should make use of the fallback chain.
It doesn't make much sense to display the entity id if there is no label, I assume. It would be pretty confusing to see an id without context.

So should we in case of the data not being translated just "hide" it by not displaying it? I guess this is the only option we have, but will be very messy when it comes to limiting results as in T117556 because the number of statements existing might then differ from the number of statements we are actually showing.

As a quick fix, I will make a patch to display the entity id, so it can be tested properly. But as mentioned before, I don't think that's the way we want to display it in the end. (Therefore, the patch shouldn't be merged, too.)

Change 254945 had a related patch set uploaded (by Lucie Kaffee):
Show entityId if no label provided

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

We should not hide information if it doesn't have a label. We would get into situations where a person just has one child for example while they have several. We should do the same thing we do in articles right now when no label is defined in the language.

Okay, I think we could merge the patch like this than. :)

Lucie moved this task from Proposed to Done on the Wikidata-Sprint-2015-11-17 board.
Lucie moved this task from Review to Done on the ArticlePlaceholder board.

Change 254945 merged by jenkins-bot:
Show entityId if no label provided

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