diff --git a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php index b9279d0..bb45c6a 100644 --- a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php +++ b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php @@ -7,6 +7,7 @@ namespace Drupal\Core\ParamConverter; +use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\TypedData\TranslatableInterface; use Symfony\Component\HttpFoundation\Request; @@ -41,7 +42,7 @@ public function convert($value, $definition, $name, array $defaults, Request $re $entity_type = substr($definition['type'], strlen('entity:')); if ($storage = $this->entityManager->getStorage($entity_type)) { $entity = $storage->load($value); - if ($entity instanceof TranslatableInterface) { + if ($entity instanceof EntityInterface && $entity instanceof TranslatableInterface) { $entity = $this->entityManager->getTranslationFromContext($entity, NULL, array('operation' => 'entity_upcast')); } return $entity;