Closed (fixed)
Project:
Webform Multiple File Upload
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2011 at 10:54 UTC
Updated:
3 Feb 2012 at 20:40 UTC
I want to use a form with the option to upload files, so in webform, the field multfile is not mandatory. Everything works great, if users upload one or more files, but when they submit their entries without any uploads, the following error message is shown:
warning: Invalid argument supplied for foreach() in /www/htdocs/[.......]/sites/all/modules/webform_multifile/multifile.inc on line 571.
This message shows up three times (at the same time). Line 571 in multifile.inc is marked below:
/**
* Format the output of text data for this component
*/
function theme_webform_display_multifile($element) {
$output = '';
foreach ($element['#value'] as $file) { <<<< Line 571
if (!empty($file)) {
$url = webform_multifile_url($file->filepath);
if ($element['#format'] == 'html') {
$output .= '<div class="multifile-file">';
$output .= l($file->filename, $url);
$output .= '</div>';
}
else {
$output .= $file->filename . ': ' . $url . "\n";
}
}
}
return $output;
}
Any idea?
Comments
Comment #1
jelle_sthis should fix it:
This should be fixed in the latest dev version (download from git or wait at least 12 hours to download it from drupal.org). Can you confirm?
Comment #2
flirpkrahusel commentedHi Jelle_S,
yes, it works perfectly, thank you very much!!
Sven