diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index eed74df..67476c6 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -58,7 +58,10 @@ function content_translation_module_implements_alter(&$implementations, $hook) { $implementations['content_translation'] = $group; break; - // And some to the top of the list. + // Since in this hook implementation we are changing the form language, by + // acting first we minimize the risk of having inconsistent behaviors due to + // different hook_entity_prepare_form() implementations assuming different + // form languages. case 'entity_prepare_form': $group = $implementations['content_translation']; unset($implementations['content_translation']); @@ -300,7 +303,7 @@ function content_translation_entity_prepare_form(EntityInterface $entity, $form_ */ function content_translation_prepare_translation_form(EntityInterface $entity, $source, $target, array &$form_state) { if (empty($form_state['content_translation']['prepared']) && $entity->isTranslatable() && content_translation_access($entity, $source ? 'create' : 'update')) { - // Avoid preparing the entity twice. + // Avoid preparing the entity form twice. $form_state['content_translation']['prepared'] = TRUE; // If no valid translation language is specified, we just let the entity