Skip to content
Snippets Groups Projects
Commit b524d3d5 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2409661 by yched: Remove duplicate check for "FieldableEntity" in EntityDisplayBase

parent 64042b01
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment