From 0f90b3054eb7b98e955e9b9b4988e4ce1c22fbf9 Mon Sep 17 00:00:00 2001 From: Kristiaan Van den Eynde Date: Fri, 12 May 2017 11:34:45 +0200 Subject: [PATCH] Interdiff --- core/modules/content_translation/content_translation.module | 2 +- .../src/Controller/ContentTranslationController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 3fd405c..8dbd170 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -299,7 +299,7 @@ function content_translation_form_alter(array &$form, FormStateInterface $form_s // Let the content translation handler alter the content entity form. This can // be the 'add' or 'edit' form. It also tries a 'default' form in case neither // of the aforementioned forms are defined. - if ($entity instanceof ContentEntityInterface && $entity->isTranslatable() && count($entity->getTranslationLanguages()) > 1 && in_array($op, ['edit', 'add', 'default'])) { + if ($entity instanceof ContentEntityInterface && $entity->isTranslatable() && count($entity->getTranslationLanguages()) > 1 && in_array($op, ['edit', 'add', 'default'], TRUE)) { $controller = \Drupal::entityManager()->getHandler($entity->getEntityTypeId(), 'translation'); $controller->entityFormAlter($form, $form_state, $entity); diff --git a/core/modules/content_translation/src/Controller/ContentTranslationController.php b/core/modules/content_translation/src/Controller/ContentTranslationController.php index 439c1e8..c18eab3 100644 --- a/core/modules/content_translation/src/Controller/ContentTranslationController.php +++ b/core/modules/content_translation/src/Controller/ContentTranslationController.php @@ -339,7 +339,7 @@ public function add(LanguageInterface $source, LanguageInterface $target, RouteM // See https://www.drupal.org/node/2006348. // Use the add form handler, if available, otherwise default. - $operation = $entity->getEntityType()->getFormClass('add') ? 'add' : 'default'; + $operation = $entity->getEntityType()->hasHandlerClass('form', 'add') ? 'add' : 'default'; $form_state_additions = []; $form_state_additions['langcode'] = $target->getId(); @@ -372,7 +372,7 @@ public function edit(LanguageInterface $language, RouteMatchInterface $route_mat // See https://www.drupal.org/node/2006348. // Use the edit form handler, if available, otherwise default. - $operation = $entity->getEntityType()->getFormClass('edit') ? 'edit' : 'default'; + $operation = $entity->getEntityType()->hasHandlerClass('form', 'edit') ? 'edit' : 'default'; $form_state_additions = []; $form_state_additions['langcode'] = $language->getId(); -- 2.8.1