milesj / uploader

[Deprecated] A CakePHP plugin for file uploading and validating.
MIT License
193 stars 73 forks source link

Problems with delete #149

Closed hugofabricio closed 11 years ago

hugofabricio commented 11 years ago

I have the following problem when remove a record, only the images are removed, the registry is still there, removed the plugin and registration is usually removed then it is problem, someone has gone through this?

Model: https://gist.github.com/hugofabricio/6812344

Controller: https://gist.github.com/hugofabricio/6813288

hugofabricio commented 11 years ago

I removed the line $ model-> id = null; in AttachmentBehavior.php function deletefiles and is working now.

edbizarro commented 11 years ago

i have the same problem, started after i updated the Uploader plugin

comment the line seems to be the way :+1:

redking commented 11 years ago

I'm having the same issue - again, solved by commenting this line

johannesnagl commented 11 years ago

+1 here

milesj commented 11 years ago

Do you mean the record in the DB isn't deleted?

I set the ID to null as deleteFiles() modifies the ID during the process. I'll look into it, but I can understand why it messes up.

hugofabricio commented 11 years ago

Yes, the image is removed, but the record remains in the database, removed the line $ model-> id = null, and worked perfectly.

styks1987 commented 11 years ago

Hey thanks hugofabricio I removed that from line 476 in the AttachmentBehavior and I was able to delete again. Thanks!