Closed (fixed)
Project:
FileField
Version:
6.x-3.0
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 May 2009 at 13:54 UTC
Updated:
13 Jun 2009 at 02:10 UTC
Could I suggest initializing the $files variable in filefield_get_node_files() to an empty array, that way external callers won't have to check the return prior to iterating in a foreach loop.
Currently if no files are attached to a node, then a NULL is returned and foreach throws warnings.
function filefield_get_node_files($node, $field = NULL) {
$files = array();
...
return $files;
}
Thanks,
Ron.
Comments
Comment #1
quicksketchCertainly. A small error on my part. Thanks!
http://drupal.org/cvs?commit=218292
Comment #2
rjerome commentedGreat, thanks.
Ron.
Comment #3
quicksketchNow why'd I mark that critical...