diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php index a1c8e84e5347bd84c98b3e233dc922611aba61f0..05c0144e4e6fd9c4583e965b0f5f9b57f89a0b0b 100644 --- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php +++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php @@ -126,7 +126,7 @@ public function __construct(array $values, $entity_type) { } if (!$this->entityManager()->getDefinition($values['targetEntityType'])->isSubclassOf('\Drupal\Core\Entity\FieldableEntityInterface')) { - throw new \InvalidArgumentException('EntityDisplay entities can only handle content entity types.'); + throw new \InvalidArgumentException('EntityDisplay entities can only handle fieldable entity types.'); } // A plugin manager and a context type needs to be set by extending classes. @@ -388,12 +388,6 @@ protected function getFieldDefinition($field_name) { * Returns the definitions of the fields that are candidate for display. */ protected function getFieldDefinitions() { - // Entity displays are sometimes created for non-content entities. - // @todo Prevent this in https://drupal.org/node/2095195. - if (!\Drupal::entityManager()->getDefinition($this->targetEntityType)->isSubclassOf('\Drupal\Core\Entity\FieldableEntityInterface')) { - return array(); - } - if (!isset($this->fieldDefinitions)) { $definitions = \Drupal::entityManager()->getFieldDefinitions($this->targetEntityType, $this->bundle); // For "official" view modes and form modes, ignore fields whose