Delete FileField Content when field is deleted.
joachim - April 14, 2008 - 16:08
| Project: | FileField |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
CCK: 5.x-1.6-1
Imagefield: 5.x-1.1
I had one image field on my site, set on one content type.
I deleted the field.
I expected the image files uploaded to this field to be deleted from my server's directory, but they are still there.

#1
Yeah CCK doesn't let modules know this is happening... CCK will have to be updated upstream I can probably put something in place after the 6.x ports are done.
#2
We can now do this with CCK 2.x in Drupal 6. Here's the relevant code from content_field_instance_delete():
<?php// Invoke hook_content_fieldapi().
module_invoke_all('content_fieldapi', 'delete instance', $field);
?>
Moving to FileField since it controls storing the files.
#3
subscribing
#4
Just upgraded from the Alpha version of this today to 6.x-3.2. In the alpha version if a file was removed, it was also deleted from the server as well. This is not the case with the latest module. This is causing problems with the View I set up. The file should be deleted from the view (like it was in the Alpha version) but it is not.