X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fcontent_translation%2Fcontent_translation.module;h=0ab227b7899e2c8245fd0d6af39593cfd7b141fd;hb=9424afc6c1f518c301bf87a23c047d1873435d05;hp=cd8b27fdacf19fde4387b96472481759302cf40a;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/web/core/modules/content_translation/content_translation.module b/web/core/modules/content_translation/content_translation.module index cd8b27fda..0ab227b78 100644 --- a/web/core/modules/content_translation/content_translation.module +++ b/web/core/modules/content_translation/content_translation.module @@ -333,9 +333,11 @@ function content_translation_form_alter(array &$form, FormStateInterface $form_s // Handle fields shared between translations when there is at least one // translation available or a new one is being created. if (!$entity->isNew() && (!isset($translations[$form_langcode]) || count($translations) > 1)) { - $langcode_key = $entity->getEntityType()->getKey('langcode'); foreach ($entity->getFieldDefinitions() as $field_name => $definition) { - if (isset($form[$field_name]) && $field_name != $langcode_key) { + + // Allow the widget to define if it should be treated as multilingual + // by respecting an already set #multilingual key. + if (isset($form[$field_name]) && !isset($form[$field_name]['#multilingual'])) { $form[$field_name]['#multilingual'] = $definition->isTranslatable(); } }