As a follow-up to #618654: File and image fields are treated as temporary files and automatically deleted after six hours, I've been building a set of tests to test image field functionality alongside file field functionality.

Note that this patch is currently based on #618654: File and image fields are treated as temporary files and automatically deleted after six hours, and will need to be changed once that patch goes in. Nonetheless, the permanence issues with image field are also solved by that patch.

The 4 new fails that I get on the new image field revisions test are as follows:

  • Second file is now deleted after deleting third revision, since it is no longer being used by any other nodes.
  • Second file entry is now deleted after deleting third revision, since it is no longer being used by any other nodes.
  • Original file is deleted after deleting the entire node with two revisions remaining.
  • Original file entry is deleted after deleting the entire node with two revisions remaining.

(Or, see the attached image: Test result | D7 Patches)

CommentFileSizeAuthor
#1 709904-failing-test-1.patch7.39 KBSteven Merrill
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Steven Merrill’s picture

Status: Active » Needs review
FileSize
7.39 KB

Here's the patch. It should fail four times, as noted above.

Steven Merrill’s picture

I also have some homework to do here, such as double-checking this against imagefield in D6 and checking if this is desired behavior or not.

Status: Needs review » Needs work

The last submitted patch, 709904-failing-test-1.patch, failed testing.

tormu’s picture

Ahem.. I just ran to this bug by adding an image field, uploading a picture for it and then deleting it - the file itself is not deleted from the server, and the usage count in the field_usage is not changed to 0 so I can't even delete it from admin/content/media.
Isn't this more of a critical than just normal?
If I upload a picture of John Doe's mom by accident and notice it right after, there's no way to remove it other than by going straight to SQL and file system?

-Mania-’s picture

I'm having issues with this as well. Makes me wonder why there's not many reports of this as it is a serious problem.

I have done a few manual tests and I think I've narrowed the problem to the following: Image fields that are set as a 'Required field' do not get deleted from the server. If I remove the 'Required field' setting the image files are removed successfully from the server. Can anyone else confirm this? I am using an image field in the user account settings if that makes a difference.