Delete doesn't work for missing files
smk-ka - July 8, 2008 - 17:35
| Project: | ImageField |
| Version: | 5.x-2.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | smk-ka |
| Status: | closed |
Jump to:
Description
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.
| Attachment | Size |
|---|---|
| imagefield-delete.patch | 889 bytes |

#1
+1
#2
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.. ;)
#3
Automatically closed -- issue fixed for two weeks with no activity.