diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index 2ece2b5..2829589 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -773,6 +773,9 @@ public function removeTranslation($langcode) { } } $this->translations[$langcode]['status'] = static::TRANSLATION_REMOVED; + if ($this->activeLangcode == $langcode) { + $this->activeLangcode = LanguageInterface::LANGCODE_DEFAULT; + } } else { $message = 'The specified translation (@langcode) cannot be removed.'; diff --git a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php index 8759d56..e371509 100644 --- a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php +++ b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php @@ -8,7 +8,7 @@ namespace Drupal\Core\ParamConverter; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\TypedData\TranslatableInterface; +use Drupal\Core\Entity\EntityInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; @@ -41,7 +41,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 = $this->entityManager->getTranslationFromContext($entity); } return $entity;