diff --git a/includes/entity.inc b/includes/entity.inc index 9bb9e3b..edf158a 100644 --- a/includes/entity.inc +++ b/includes/entity.inc @@ -30,6 +30,7 @@ class Entity { protected $entityType; protected $entityInfo; protected $idKey, $nameKey, $statusKey; + protected $defaultLabel = FALSE; /** * Creates a new entity. @@ -119,9 +120,10 @@ class Entity { * @see entity_label() */ public function label() { - if (isset($this->entityInfo['label callback']) && $this->entityInfo['label callback'] == 'entity_class_label') { + if ($this->defaultLabel || (isset($this->entityInfo['label callback']) && $this->entityInfo['label callback'] == 'entity_class_label')) { return $this->defaultLabel(); } + $this->defaultLabel = TRUE; return entity_label($this->entityType, $this); }