diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 626bbc0..554a529 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -500,10 +500,10 @@ function language_form_alter(&$form, FormStateInterface $form_state, $form_id) { $form_object = $form_state->getFormObject(); if ($form_object instanceof ContentEntityFormInterface && isset($form['langcode'])) { /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity = $form_object->getEntity(); - if ($entity->isTranslatable()) { - $entity_type_id = $form_object->getEntity()->getEntityTypeId(); - $bundle = $form_object->getEntity()->bundle(); + $entity_type_id = $form_object->getEntity()->getEntityTypeId(); + $bundle = $form_object->getEntity()->bundle(); + $entity_type = Drupal::entityManager()->getDefinition($entity_type_id); + if ($entity_type->isTranslatable()) { $language_configuration = ContentLanguageSettings::loadByEntityTypeBundle($entity_type_id, $bundle); $form['langcode']['#access'] = $language_configuration->isLanguageAlterable(); }