Closed (works as designed)
Project:
ImageField
Version:
6.x-3.7
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2010 at 00:13 UTC
Updated:
8 Dec 2010 at 22:45 UTC
I have been developing a cck widget and have been using imagefield as an example. In the process of me reusing some of the code I found a small bug. In your function '_imagefield_widget_settings_default_validate' you save the file and then check to see if there is an old file and delete it. The order of operations is an issue when you try and upload the same file twice. It ends up deleting it self. Perhaps you should delete the file first and then save. Hope this helps! Thanks again for the wonderful module and the great example, couldn't have built my module with out it!
Comments
Comment #1
quicksketchIf you upload the same file twice, the second file is renamed with a "_0" appended to the file name, such as example_0.png. Then the original file, example.png, is deleted but the second one remains.
Comment #2
quicksketchI double-checked this again today and found that ImageField works as I described in #1.
Comment #3
pwaterz commentedI do apologized, I checked it again it seems to be working,