Images being deleted
marcus0263 - March 11, 2009 - 18:11
| Project: | User titles |
| Version: | 6.x-1.0-beta2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
I've created 4 titles based on post count. I have images attached to them. The first title based on 1 post "newb" is fine, the other three after a few hours are deleted out of the files/user-titles-images directory. They all have the same permissions so I'm rather stumped as to why the images are deleted.

#1
I am also having this same problem. I uploaded all the images from user titles admin and all worked at first. Now all my images
have disappeared from the folder.
I wonder if the problem is created when I clear the website cache. This shouldn't cause the images to disappear once they
are uploaded.
#2
Should the user-titles-images folder be set to "777" permissions? My folder is currently 775.
From what I have been reading about images disappearing "in general"....when it is uploaded, if it is
considered by drupal to be a "tmp" temporary image, drupal will purge it out after a while unless it is
set to be a permanent image.
Not sure if fixing this is just setting permissions to 777 or maybe this:
http://api.drupal.org/api/function/file_save_upload/6
#3
I am still having this problem. Can't change permissions on the images folder since drupal owns it. That probably wouldn't make any difference anyway. I think there is a problem in the User Titles module that is causing this. Other modules that implement images do not do this on my site. User Titles is uploading the images and Drupal is treating them as temporary files and therefore deleting them out.
Maybe something like this needs to be in the module somewhere:
file_save_upload($source, $validators = array(), $dest = FALSE, $replace = FILE_EXISTS_RENAME)#4
Yep now all images are gone.
#5
Another observation...I have no problem with the "User Badges" module working without deleting images. However, I don't plan to use user badges. I want user titles because it can show rank images based on user post count. User titles works perfectly for about 6 hours until drupal does a site cron.
I guess most user titles users are just using "text" titles functionality instead of images.
#6
See comment #14 here:
http://drupal.org/node/357711
I know this is a different module but same problem in how the files are being saved.
#7
I found the problem in user_titles.module. As I found in #6 above, it clued me in on what was missing from the module. I made a patch to add a line to make uploaded images permanent. Works fine for me now.
#8
#9
Changing status