diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index b09d9ff..24a8f76 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -12,6 +12,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Config\Entity\ConfigEntityType; use Drupal\Core\DependencyInjection\ClassResolverInterface; use Drupal\Core\Entity\Exception\AmbiguousEntityClassException; use Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException; @@ -985,9 +986,12 @@ public function loadEntityByConfigTarget($entity_type_id, $target) { $entity_type = $this->getDefinition($entity_type_id); // For configuration entities, the config target is given by the entity ID. - // @todo Should we allow entity types to return their target identifier key - // rather than hard-coding this check? - if ($entity_type instanceof ConfigEntityTypeInterface) { + // @todo Consider adding a method to allow entity types to indicate the + // target identifier key rather than hard-coding this check. Issue: + // https://www.drupal.org/node/2341357 + // @todo We need to add test coverage for references to config entities as + // nothing failed when this first condition was broken. + if ($entity_type instanceof ConfigEntityType) { $entity = $this->getStorage($entity_type_id)->load($target); } diff --git a/core/modules/views/src/Plugin/views/area/Entity.php b/core/modules/views/src/Plugin/views/area/Entity.php index c49756d..d68eee8 100644 --- a/core/modules/views/src/Plugin/views/area/Entity.php +++ b/core/modules/views/src/Plugin/views/area/Entity.php @@ -162,7 +162,6 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) { * {@inheritdoc} */ public function render($empty = FALSE) { - // @todo Simplify this code. if (!$empty || !empty($this->options['empty'])) { // @todo Use a method to check for tokens in // https://www.drupal.org/node/2396607.