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
- Enable the Locale module
- Enable the field_collection_bulkupload module
- Add a language
- Enable the Multilingual support for a content type
- Create field collection on this content type
- Add image field to field collection
- Create content in the new language
- 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);
}
}
}| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fix_multilingual_forms-2033115-2.patch | 937 bytes | ram4nd |
| #1 | fix_multilingual_forms-2033115-1.patch | 0 bytes | ram4nd |
Comments
Comment #1
ram4nd commentedI had the same issue with it but with other languages. I also made a patch of your proposed solution.
Comment #2
ram4nd commentedSeems like I posted an empty file, as I can't edit that...
Comment #3
ram4nd commentedComment #4
guardiola86 commentedIt worked, thanks
Comment #6
ram4nd commented