diff --git a/core/modules/translation_entity/translation_entity.admin.inc b/core/modules/translation_entity/translation_entity.admin.inc index f8ece47..2548c30 100644 --- a/core/modules/translation_entity/translation_entity.admin.inc +++ b/core/modules/translation_entity/translation_entity.admin.inc @@ -73,10 +73,16 @@ function _translation_entity_form_language_content_settings_form_alter(array &$f $dependent_options_settings = array(); foreach ($form['#labels'] as $entity_type => $label) { $entity_info = entity_get_info($entity_type); - // Only show the checkbox to enable translation if the bundles in the entity - // might have fields. - if (!empty($entity_info['fieldable'])) { - foreach (entity_get_bundles($entity_type) as $bundle => $bundle_info) { + foreach (entity_get_bundles($entity_type) as $bundle => $bundle_info) { + // Here we do not want the widget to be altered and hold also the + // "Enable translation" checkbox, which would be redundant. Hence we + // add this key to be able to skip alterations. + $form['settings'][$entity_type][$bundle]['settings']['language']['#translation_entity_skip_alter'] = TRUE; + + // Only show the checkbox to enable translation if the bundles in the + // entity might have fields. + if (!empty($entity_info['fieldable'])) { + // Only show the checkbox to enable translation if there are fields to // translate. $has_fields = field_info_instances($entity_type, $bundle); @@ -86,11 +92,6 @@ function _translation_entity_form_language_content_settings_form_alter(array &$f '#default_value' => translation_entity_enabled($entity_type, $bundle), ); - // Here we do not want the widget to be altered and hold also the - // "Enable translation" checkbox, which would be redundant. Hence we - // add this key to be able to skip alterations. - $form['settings'][$entity_type][$bundle]['settings']['language']['#translation_entity_skip_alter'] = TRUE; - // @todo Exploit field definitions once all core entities and field // types are migrated to the Entity Field API. foreach (field_info_instances($entity_type, $bundle) as $field_name => $instance) {