Hello all.
I using drupal 7.12 and field collection 7.x-1.0-beta4.
I will describe my problem as bellow :
I create a new content type. Next I add a field collection field and put an image field and a text field inside a the field collection.
After that I create add new content to the new contain type. When i upload image to the image field, there are two warnings as bellow:
Warning: Invalid argument supplied for foreach() in file_field_widget_submit() (line 760 of /var/www/drupal7/modules/file/file.field.inc).
Warning: array_values() expects parameter 1 to be array, null given in file_field_widget_submit() (line 767 of /var/www/drupal7/modules/file/file.field.inc).
May I know how to fix this problem since this is field collection module is very important to my project.
Thanks in advance.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | field_collection-validation_fix-1545584-14.patch | 710 bytes | blueminds |
Comments
Comment #1
indigoxela commentedHi tyx,
I would say, your problem ist related to http://drupal.org/node/1329856 (beta3).
That bug is not fixed yet in field collection 7.x-1.0-beta4 and as far as I know, there is no patch available for beta4.
These issues are also related to http://drupal.org/node/1468686, but it guess they should be fixed in field_collection first and we should avoid to patch around in core.
Comment #2
drupa11y commentedWith Drupal 7.14 I get this error when I select a multimedia widget image:
Fatal error: Call to undefined function file_entity_file_is_local() in /Applications/MAMP/htdocs/thezooproject/sites/default/modules/media-modules/media/modules/mediafield/mediafield.module on line 198
Comment #3
drupa11y commentedAnother error I get now:
Fatal error: Call to undefined function entity_i18n_string() in /Applications/MAMP/htdocs/thezooproject/sites/default/modules/cck-modules/field_collection/field_collection.module on line 869
Comment #4
drupa11y commentedProblem of this error is that several modules need an exact combination.
More on this topic is in the "media"-file issue list here: http://drupal.org/node/1516804
For media 1.0 it turns out that the file_entity module was installed and it was conflicting with media module.
For media 2.x the latest devs are necessary: file_entity 7.x-2.x-dev & media 7.x-2.x-dev
Thread "field collection dev requires entity api dev version": http://drupal.org/node/1471840
Thread for "Undefined function entity_i18n_string()": http://drupal.org/node/1448594
Thread in media "Call to undefined function file_entity_file_is_local": http://drupal.org/node/1516804
Hope this helps solving some issues.
Comment #5
donpwinston commentedI'm using a "field collection" field as an embedded widget. The image field gives the following warnings when used in my form. These errors do not occur when I use an image field in the normal way. It still "works" but the warnings are not acceptable.
Please fix this or tell me how to fix it.
Comment #6
donpwinston commentedObviously the same thing happens with the file widget
Comment #7
blueminds commentedfield_collection unsets some values from $form_state array which results in this error. It is done in the field_collection_field_widget_embed_validate() function on lines 1288, 1289. Problem arises because FAPI validation expects following parents:
field_images, und, 0, field_gallery_image, und
however these are provided:
field_images, und, 0, entity
To fix it add following code on the line 1280:
$item = drupal_array_get_nested_value($form_state['values'], $element['#parents']);to remain former items in the array.
Comment #8
donpwinston commentedThanks. That appears to work.
Comment #9
blueminds commentedsee #7
Comment #10
fagoPlease roll a proper patch file.
Comment #11
puppyman commentedhooray #7
Comment #12
j-phat commented#7 says to add the line in line 1280 but i only have a total of 1015 lines in the
file.field.incfiledrupal 7.14
Field collection 7.x-1.0-beta4
Comment #13
blueminds commented#12 - wrong module, wrong file. Go for file field_collection.module in the field_collection module.
Comment #14
blueminds commentedthe patch for #7
Comment #15
Goekmen commentedThanks for the patch, working for me!
Comment #16
yannickooYes! Thanks for the patch, works. Can we mark this issue as RTBC?
Comment #17
dmtrfoxerr commented#14: field_collection-validation_fix-1545584-14.patch queued for re-testing.
Comment #18
dmtrfoxerr commentedThanks for the patch, works.
Comment #19
ChrisConolly commentedI've applied this patch to field_collection 7.x-1.0-beta4 using drupal 7.14 and I still have the same problem. The image does upload but it seems to get lost and none of the imagecahce presets generate for it.
Any other ideas?
**Edit**
Sorry, I was too quick to assume this was the problem (it was a problem I had when dev'ing). Turns out the client's being messing around with their server setup and that broke it.
Comment #20
star-szrSounds like we have pretty good consensus and the patch looks reasonable.
Comment #21
fagoThanks, I've added a comment explaining it and committed it.
Comment #22
kris-o3 commentedthe line number didn't quite match my version of field_collection.module but i was able to find where to apply this patch...
worked for me!
Comment #24
kris-o3 commentedran into this problem as well... field_collection beta4...
the patch in #14 appears to have resolved the issue.