From b524d3d59c79d9fd44eea7e52678f6d0d54c74fc Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 3 Feb 2015 16:04:49 +0000
Subject: [PATCH] Issue #2409661 by yched: Remove duplicate check for
 "FieldableEntity" in EntityDisplayBase

---
 core/lib/Drupal/Core/Entity/EntityDisplayBase.php | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
index a1c8e84e5347..05c0144e4e6f 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
-- 
GitLab