summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/language/language.module
diff options
context:
space:
mode:
authorAlex Pott <alex.a.pott@googlemail.com>2015-08-06 15:15:04 +0100
committerAlex Pott <alex.a.pott@googlemail.com>2015-08-06 15:15:04 +0100
commitbd1964cb366531654c01314bd04ecffd9b85300e (patch)
treebb26556035144623d54f97ae981de5fac8b37c98 /core/modules/language/language.module
parent1569740d0caf3570aeb414a5bbf767bcabca86e4 (diff)
downloaddrupal-bd1964cb366531654c01314bd04ecffd9b85300e.tar.gz
drupal-bd1964cb366531654c01314bd04ecffd9b85300e.zip
Issue #2533964 by edurenye, Berdir, Gábor Hojtsy: Langcode widget visibility settings from language.module are not applied consistently
Diffstat (limited to 'core/modules/language/language.module')
-rw-r--r--core/modules/language/language.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 29c93d2cf9e..75013656212 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -427,12 +427,12 @@ function language_form_alter(&$form, FormStateInterface $form_state) {
// Content entity forms may have added a langcode field. But content language
// configuration should decide if it should be exposed or not in the forms.
$form_object = $form_state->getFormObject();
- if ($form_object instanceof ContentEntityFormInterface) {
+ if ($form_object instanceof ContentEntityFormInterface && $form_object->getEntity()->getEntityType()->hasKey('langcode')) {
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = $form_object->getEntity();
$entity_type = $entity->getEntityType();
$langcode_key = $entity_type->getKey('langcode');
- if (isset($form[$langcode_key]) && $entity_type->isTranslatable()) {
+ if (isset($form[$langcode_key])) {
$language_configuration = ContentLanguageSettings::loadByEntityTypeBundle($entity->getEntityTypeId(), $entity->bundle());
$form[$langcode_key]['#access'] = $language_configuration->isLanguageAlterable();
}