I'm not sure if this is because of something else I'm doing, but when I try to save a node that has a filefield with no content in it, I get a SQL error stating that fid doesn't have a default value. The SQL looks something like INSERT INTO ?? (width,height) VALUES (0,0).
In trying to fix this error from happening on node_save();, I added a conditional in filefield_field.inc in filefield_field_update(); that checks to make sure that the fid isn't NULL before trying to operate on it.
From my testing, it looks like node_load(); will create the field with no elements, but on presave the content module will populate the field with a single-element array that has NULL for each of the filefield's properties. This is why I made the change where I did.
Can anyone else reproduce this?
Comments
Comment #1
drewish commentedi think this is a duplicate of #342615: Missing handling for empty field content