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

quicksketch’s picture

The order of operations is an issue when you try and upload the same file twice. It ends up deleting it self.

If 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.

quicksketch’s picture

Status: Active » Closed (works as designed)

I double-checked this again today and found that ImageField works as I described in #1.

pwaterz’s picture

I do apologized, I checked it again it seems to be working,