Active
Project:
SWFUpload
Version:
7.x-1.0-alpha1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2013 at 00:36 UTC
Updated:
6 Feb 2013 at 00:36 UTC
Got a warning after saving nodes without entering any images:
Warning: Invalid argument supplied for foreach() in swfupload_widget_value() (line 84 of .../sites/all/modules/swfupload/swfupload_widget.inc).
Fixed it by checking for is_array($input) on a line insertion around the mentioned foreach() statement. Final code:
// Files need an integer value for the 'display' field.
if( is_array($input) ){
foreach ($input as $fid => $file) {
if (empty($file['display'])) {
$input[$fid]['display'] = 0;
}
}
}
return $input;
Cheers