diff --git a/includes/commerce_product.inline_entity_form.inc b/includes/commerce_product.inline_entity_form.inc index 628f6c7..9b95433 100644 --- a/includes/commerce_product.inline_entity_form.inc +++ b/includes/commerce_product.inline_entity_form.inc @@ -245,10 +245,6 @@ class CommerceProductInlineEntityFormController extends EntityInlineEntityFormCo } } - // Ensure our fieldsets are not hidden by the field translation handler. - $entity_form['product_image']['#access'] = TRUE; - $entity_form['product_details']['#access'] = TRUE; - return $entity_form; } diff --git a/includes/entity.inline_entity_form.inc b/includes/entity.inline_entity_form.inc index 6b71db0..64f1aff 100644 --- a/includes/entity.inline_entity_form.inc +++ b/includes/entity.inline_entity_form.inc @@ -303,7 +303,8 @@ class EntityInlineEntityFormController { // In this case we need to rebuild the form with the correct form language // and replace the field elements with the correct ones. // Borrowed some code from entity_translation_field_attach_form() - // that won't get run because $form_state['rebuild'] is TRUE for all IEF forms. + // that won't get run because $form_state['rebuild'] is TRUE for all IEF + // forms. if ($update_langcode || ($source && !isset($translations->data[$form_langcode]) && isset($translations->data[$source]))) { $entity_type = $entity_form['#entity_type']; list($id, , $bundle) = entity_extract_ids($entity_type, $entity_form['#entity']); @@ -312,10 +313,11 @@ class EntityInlineEntityFormController { $field_name = $instance['field_name']; $field = field_info_field($field_name); - // If we are creating a new translation we have to change the form item - // language information from source to target language, this way the - // user can find the form items already populated with the source values - // while the field form element holds the correct language information. + // If we are creating a new translation we have to change the form + // item language information from source to target language, this way + // the user can find the form items already populated with the source + // values while the field form element holds the correct language + // information. if ($field['translatable']) { $element = &$entity_form[$field_name]; $element['#entity_type'] = $entity_type; @@ -326,17 +328,17 @@ class EntityInlineEntityFormController { $element['#previous'] = NULL; $element['#form_parents'] = $entity_form['#parents']; - // If we are updating the form language we need to make sure that the - // wrong language is unset and the right one is stored in the field - // element (see entity_translation_prepare_element()). + // If we are updating the form language we need to make sure that + // the wrong language is unset and the right one is stored in the + // field element (see entity_translation_prepare_element()). if ($update_langcode) { $element['#previous'] = $element['#language']; $element['#language'] = $form_langcode; } - // Swap default values during form processing to avoid recursion. We - // try to act before any other callback so that the correct values are - // already in place for them. + // Swap default values during form processing to avoid recursion. + // We try to act before any other callback so that the correct + // values are already in place for them. if (!isset($element['#process'])) { $element['#process'] = array(); } diff --git a/inline_entity_form.module b/inline_entity_form.module index 8203ef4..111c606 100644 --- a/inline_entity_form.module +++ b/inline_entity_form.module @@ -995,7 +995,8 @@ function inline_entity_form_entity_form($controller, $entity_form, &$form_state) $save_label = t('Clone @type_singular', array('@type_singular' => $labels['singular'])); } - // Register a child entity translation handler to properly deal with the entity form language. + // Register a child entity translation handler to properly deal with the + // entity form language. list(, , $bundle) = entity_extract_ids($entity_form['#entity_type'], $entity_form['#entity']); if (module_invoke('entity_translation', 'enabled', $entity_form['#entity_type'], $bundle) && $entity_form['#parent_entity']->translations->original != null) { inline_entity_form_add_child_translation_handler($entity_form);