Patch checks if the field is empty before foreach().

Comments

q0rban’s picture

Title: PHP notice on node update » foreach errors on update
StatusFileSize
new497 bytes

So, to explain this a bit further, basically filefield looks for deleted files on a node that didn't have any files to begin with. So you get errors on the foreach on line 124 since $orig->$field['field_name'] is not an array.

q0rban’s picture

Title: foreach errors on update » foreach errors after editing a node with no files
dopry’s picture

Status: Needs review » Reviewed & tested by the community
amitaibu’s picture

I think that the if !empty is more standard then casting to (array).

quicksketch’s picture

Status: Reviewed & tested by the community » Closed (duplicate)