Posted by troynt on May 10, 2009 at 1:00am
| Project: | Image FUpload |
| Version: | 6.x-3.0-rc2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Solution add is_array check before foreach loop.
Comments
#1
can you please elaborate on your fix? I'm new at this and I'm having the same issue.
#2
Can't reproduce this error message. Perhaps you added some fields and didn't resave ImageFields settings page.
#3
Hi,
get the same error,
really not expert, I'm sorry
but I cannot understand the solution,
"Solution add is_array check before foreach loop."
I get this error below, just after a fresh installation.
Fatal error: Call to undefined function image_node_type_load() in .../modules/image_fupload/image_fupload_imagefield/image_fupload_imagefield.module on line 60
Can someone explain me how work the solution proposed above?
#4
I encountered this same error:
warning: Invalid argument supplied for foreach() in /var/www/html/drupal/sites/all/modules/image_fupload/image_fupload_imagefield/image_fupload_imagefield.module on line 506.
I had one image field using the FUpload widget, then I went and edit content type and change the name and id. That's it. Seems under some condition like this,
form_fields_destroy()is called with$fields_to_remove == NULL?#5
Thnx Matt. I can confirm that this workaround works with 6.x-3.0-dev (current release is september 2009) as well. I had changed the name of Story to Article with no result. But changing the machine readable type story to article fixed the error, (which is thrown at line 553 in dev).
#6
Hello, everybody.
I have just installed image fupload module (6.x-3.0-rc2 along with imagefield/filefield 6.x-3.2) and changed the widget type of an existing CCK field file type to "Image FUpload".
Now when I'm going to create a new page, based on the above content type, have this error at the top of the page:
warning: Invalid argument supplied for foreach() in ***fupload_imagefield.module on line 506.I didn't quite understand how the solution works, I would appreciate if someone could explain one more time.
Thank You very much
bye
zoo
#7
Hello zoo and co,
here a patch to avoid this simple php error. It is a peculiarity of the function "foreach" in php in case the array is empty.
Regards
Juan Carlos
#8
Thank You very much for your help!
zoo
#9
Hello,
I got the same error...
How can I install the patch?
Thanks
#10
#11
Committed to HEAD, thanks to jcmc and all others.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.
#13
Hi
In my case it was because there was no image cache preset selected in the field definition. Once I created and selected the preset, the error was gone
#14
ANOTHER EASY SOLUTION....
This is occurring because of conflicting default settings in your image field (if you created one before you used the FUpload module...) To fix this, go into your Content Type>>Manage Fields>>Image field (or whatever you called it) and click CONFIGURE.... choose "Multiple Images Per Node", scroll down and choose "UNLIMITED" in "Maximum number of values users can enter for this field."
should work. no patches or scary coding needed.
geoff
#15
#14 makes sense. And worked for me. Thanks.