Active
Project:
Image FUpload
Version:
6.x-3.0-rc2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2009 at 18:43 UTC
Updated:
22 Sep 2009 at 18:46 UTC
I'm getting a php warning when uploading images using the imagefield single image per node method. The exact error is:
warning: Invalid argument supplied for foreach() in .../sites/all/modules/image_fupload/includes/images.previewlist.imagefield.inc on line 38.
Similar to issue http://drupal.org/node/535160
I am not good programmer, but I did simmilar thing as in issue mentioned above.
Original:
// delete all elements without the ones we need
foreach ($form_taxonomy['taxonomy'] as $key => $value) {
// taxonomy normal
if (!in_array($key, $fields_preview_list['taxonomy']) && is_numeric($key)) {
unset($form_taxonomy['taxonomy'][$key]);
}
}New:
// delete all elements without the ones we need
if (is_array($form_taxonomy['taxonomy'])) {
foreach ($form_taxonomy['taxonomy'] as $key => $value) {
// taxonomy normal
if (!in_array($key, $fields_preview_list['taxonomy']) && is_numeric($key)) {
unset($form_taxonomy['taxonomy'][$key]);
}
}
}
Sorry but don't know how to make patch or check if it is ok. But warning is gone
Please can someone review it?
Thanks
Comments
Comment #1
agir commented