diff -u b/field_collection.module b/field_collection.module --- b/field_collection.module +++ b/field_collection.module @@ -1596,45 +1596,21 @@ $field_state['items_count'] = 1; } - // Check if this is an Entity Translation Source Form - if (module_exists('entity_translation') && isset($form['#entity_translation_source_form']) && $form['#entity_translation_source_form']) { - if (isset($items[$delta])) { - $field_collection_item = field_collection_field_get_entity($items[$delta], $field_name); - // This is the source form for a translation with field translation, therefore we must clone the field collection item - $new_entity = clone $field_collection_item; - $new_entity->item_id = NULL; - $new_entity->revision_id = NULL; - $new_entity->is_new = TRUE; - $field_state['entity'][$delta] = $new_entity; - $new_entity->setHostEntity($element['#entity_type'], $element['#entity'], 'de', FALSE); - - $new_entity->check = 'delta_' . $delta; - - $field_state['entity'][$delta] = $new_entity; - field_form_set_state($field_parents, $field_name, $language, $form_state, $field_state); - field_attach_form('field_collection_item', $new_entity, $element, $form_state, LANGUAGE_NONE); - } + if (isset($field_state['entity'][$delta])) { + $field_collection_item = $field_state['entity'][$delta]; } else { - if (isset($field_state['entity'][$delta])) { - $field_collection_item = $field_state['entity'][$delta]; + if (isset($items[$delta])) { + $field_collection_item = field_collection_field_get_entity($items[$delta], $field_name); } - else { - if (isset($items[$delta])) { - $field_collection_item = field_collection_field_get_entity($items[$delta], $field_name); - } - // Show an empty collection if we have no existing one or it does not - // load. - if (empty($field_collection_item)) { - $field_collection_item = entity_create('field_collection_item', array('field_name' => $field_name)); - } - - // Put our entity in the form state, so FAPI callbacks can access it. - $field_state['entity'][$delta] = $field_collection_item; + // Show an empty collection if we have no existing one or it does not + // load. + if (empty($field_collection_item)) { + $field_collection_item = entity_create('field_collection_item', array('field_name' => $field_name)); } - field_form_set_state($field_parents, $field_name, $language, $form_state, $field_state); - field_attach_form('field_collection_item', $field_collection_item, $element, $form_state, LANGUAGE_NONE); + // Put our entity in the form state, so FAPI callbacks can access it. + $field_state['entity'][$delta] = $field_collection_item; } // Register a child entity translation handler to properly deal with the diff -u b/includes/translation.handler.field_collection_item.inc b/includes/translation.handler.field_collection_item.inc --- b/includes/translation.handler.field_collection_item.inc +++ b/includes/translation.handler.field_collection_item.inc @@ -56,2 +56,19 @@ + /** + * {@inheritdoc} + */ + public function updateTranslations() { + $langcode = $this->getLanguage(); + + // Only create a translation on edit if the translation set is empty: + // the entity might have been created with language set to "language + // neutral". + if (empty($this->getTranslations()->data)) { + $this->initTranslations(); + } + elseif (!empty($langcode)) { + //$this->setOriginalLanguage($langcode); + } + } + }