This is an edge case: when flagging an image for deletion that is missing on the hard disc (ie. it has been manually deleted), the stored CCK field data will not be updated. This happens because imagefield_file_update() only returns an empty array (which would cause the CCK field to be updated), if the call to _imagefield_file_delete() and, subsequently, file_delete() returns true. However, if an image is flagged for deletion, the result of file_delete() shouldn't matter at all -- the image should *always* be removed from the content as requested.

The attached patch fixes the logic in imagefield_file_update() to always return an empty array.

CommentFileSizeAuthor
imagefield-delete.patch889 bytessmk-ka
imagefield-delete.patch889 bytessmk-ka

Comments

sun’s picture

Status: Needs review » Reviewed & tested by the community

+1

dopry’s picture

Status: Reviewed & tested by the community » Fixed

Hey sun... If you want to +1 a patch... try to write a sentence about how you tested it what you did and that it worked for you.. So actually review and test and post your findings!

committed to DRUPAL-5, we're blaming sun if file deletion destroys peoples sites in the next imagefield release.. ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.