Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Split of from #1616952: Add a langcode parameter to EntityInterface::label()
The default value for 'label not defined / label not found" in EntityInterface::label(), Entity::label(), entity_label() does not match.
- Docs in EntityInterface::label(): NULL
- Entity::label(): FALSE
- entity_label(): FALSE
Whats the right value? FALSE or NULL?
Comment | File | Size | Author |
---|---|---|---|
#2 | entity-label-default-1629924-2.patch | 676 bytes | Berdir |
Comments
Comment #1
fubhy CreditAttribution: fubhy commentedI would prefer NULL instead of FALSE. When invoking entity_label() we are not asking for whether the entity has a label or not so a boolean as a return value doesn't seem right to me. If the label is undefined (by definition) we should return NULL - If the label is empty (not set) we should return an empty string.
Comment #2
BerdirTrivial.
Comment #3
corvus_ch CreditAttribution: corvus_ch commentedTrivial indeed.
Comment #4
catchYep. Committed/pushed to 8.x.
Comment #5.0
(not verified) CreditAttribution: commentedFixed issue link.