image_field_insert() calls image_field_update() which calls file_field_update()
wtf 1: file_field_update() tries to return early when $entity->revision is set, shame that's only for nodes, not all entities.
wtf 2: Check for files that have been removed from the object.
yet this is called from image_field_insert().
Also there's no file_field_insert() at all. Due to the node_load($nid) here, this causes a memory leak when inserting lots of content with image fields attached, since no other code loads nodes when they're saved the first time.
Comments
Comment #1
moshe weitzman commentednice deletion.
Comment #2
dries commentedCommitted to CVS HEAD. Thanks.
Comment #3
catchThe other issues here are identified in #644338: file_field_update() triggers a full entity load durung entity_save().