0

In Drupal 7, I try to create a News, which is a custom content type, with an Image file. I upload the file (not by pressing Ajax button, but just selecting the file), and leave all the other fields (some mandatory) empty. I press Send, and I get the red errors. Even if I close the browser, the image will have been uploaded to the folder ( sites/default/files/news/images ). Even after deleting cache and running cron.php, the orphane image will be still there. Isn't it a bug of Drupal, which would have to delete those images with no associated content? The file is not reused in other content types.

0

I have discovered that the files are physically stored, and also in the database, there is an entry in the table file_managed with the field status with the following indication and value : 0

A field indicating the status of the file. Two status are defined in core:
temporary (0) and permanent (1).
Temporary files older than DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed during a cron run.

I have manually changed the timestamp of the uplodaded file, run the cron, and the file dissapears. Obviously there must be a confident time, because if not, files in contents still being update could have the risk of being deleted. My fault for not thinking of this last point.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.