I have drupal 6.28 and 6.x-3.11 of imagefield module on my website.
I have a content type called Profile which has a cck field as filefield with image widget.

Steps to replicate:

1) Try to create new content of "Profile" content type.
2) Upload a image as image.jpg Don't save the content. This results in a temporary image uploaded i.e. files table has status of this file as 0.
3) After six hours (max temp file age in system.module) when the cron runs it deletes the file from database as well as codebase but hook_file_delete is not invoked so the imagethumb remains behind as image.jpg.
4) Now Create new content of "Profile" content type and upload a different image with same name i.e. image.jpg.

Thumbnail of old image is shown instead of newly uploaded image as it exists in the folder with same name.

Ideally the thumbnail should get deleted and it is handled by writing hook_file_delete but file_delete hook is not invoked by core drupal thus causing problem.

CommentFileSizeAuthor
#1 imagefield-2044331.patch1.42 KBsadashiv
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

sadashiv’s picture

Assigned: Unassigned » sadashiv
Status: Active » Needs review
FileSize
1.42 KB

I am attaching a patch which solves this issue. It is a rare case scenario.

Hth,
Sadahiv.

sadashiv’s picture

Priority: Normal » Major