diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 1231674..a11a393 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -385,8 +385,7 @@ function content_translation_prepare_translation_form(EntityInterface $entity, $ */ function content_translation_prepare_translation(EntityInterface $entity, $source, $target) { // @todo Unify field and property handling. - $entity = $entity->getNGEntity(); - if ($entity instanceof EntityNG) { + if ($entity instanceof ContentEntityInterface) { $source_translation = $entity->getTranslation($source); $entity->addTranslation($target, $source_translation->getPropertyValues()); } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php index 9b8db14..62a0e51 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php @@ -227,11 +227,11 @@ protected function assertFormLanguage() { ->getStorageController($this->entityType) ->load($this->entityId); - $path = $this->controller->getEditPath($entity); + $uri = $entity->uri('edit-form'); $message = 'The form language can be switched to @langcode through a query string parameter'; foreach ($entity->getTranslationLanguages() as $langcode => $language) { $options = array('query' => array('content_translation_target' => $langcode)); - $this->drupalGet($path, $options); + $this->drupalGet($uri['path'], $options); $this->assertRaw($entity->getTranslation($langcode)->{$this->fieldName}->value, format_string($message, array('@langcode' => $langcode))); } }