Problem/Motivation

When modifying a content with field collection bulkupload:

Notice : Undefined index: fr in field_collection_bulkupload_add_form() (line 47 in /sites/all/modules/contrib/field_collection_bulkupload/field_collection_bulkupload.module).

Steps to reproduce

  1. Enable the Locale module
  2. Enable the field_collection_bulkupload module
  3. Add a language
  4. Enable the Multilingual support for a content type
  5. Create field collection on this content type
  6. Add image field to field collection
  7. Create content in the new language
  8. Edit this content

Proposed resolution

  function field_collection_bulkupload_field_attach_form($entity_type, $entity, &$form, &$form_state, $langcode) {
    $fields = field_info_instances($entity_type, $form['#bundle']);
    foreach($fields as $name => $field) {
      if ($field['widget']['type'] == 'field_collection_embed') {
        $build_id = $form_state['build_info']['form_id'];
+       $langcode = field_language($entity_type, $entity, $name, $langcode);
        field_collection_bulkupload_add_form($form[$name], $name, $langcode, $build_id);
      }
    }
  }

Comments

ram4nd’s picture

StatusFileSize
new0 bytes

I had the same issue with it but with other languages. I also made a patch of your proposed solution.

ram4nd’s picture

StatusFileSize
new937 bytes

Seems like I posted an empty file, as I can't edit that...

ram4nd’s picture

Status: Active » Reviewed & tested by the community
guardiola86’s picture

Issue summary: View changes

It worked, thanks

  • ram4nd committed 6da29c4 on 7.x-1.x
    Issue #2033115 by ram4nd, guardiola86, slayne40: Undefined index: fr in...
ram4nd’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.