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?

CommentFileSizeAuthor
#2 entity-label-default-1629924-2.patch676 bytesBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fubhy’s picture

I 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.

Berdir’s picture

Status: Active » Needs review
FileSize
676 bytes

Trivial.

corvus_ch’s picture

Status: Needs review » Reviewed & tested by the community

Trivial indeed.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Yep. Committed/pushed to 8.x.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Fixed issue link.