Closed (works as designed)
Project:
FileField
Version:
6.x-3.7
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2010 at 19:49 UTC
Updated:
26 Aug 2010 at 00:17 UTC
I've tried this on a sandbox site and it works fine, but I've got an existing site that I've been working over the last few months and this happens:
-Create new node and upload a file via the file field.
-Edit the node and click "remove".
-File is no longer associated with the node, but still resides in the files directory and in the "files" table with a status of "1".
I was thinking that maybe I had a conflicting module or something wrong with my file permissions, but even after digging into these two possibilities, I haven't come up with any leads. Can anyone offer any other ideas of what I might be doing wrong, please?
Comments
Comment #1
attheshow commentedFigured it out. Files aren't deleted when node revisions are turned on for your content type. This appears to be intentional (see #370531: Properly Handle Revisions for document control), but my users and I found this to be very confusing since we don't do "reverts" often at all. We do, however, need to remove old files all the time.
My patch for this on my local system was to remove from filefield_field.inc the line that says:
if ($node->is_new || !empty($node->revision) || !empty($node->skip_filefield_delete)) {and replace it with
if ($node->is_new || !empty($node->skip_filefield_delete)) {I hope this helps others.
Comment #2
quicksketchThis is intentional behavior, as noted.