Closed (fixed)
Project:
Feeds
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jul 2010 at 12:48 UTC
Updated:
22 Sep 2010 at 13:38 UTC
Jump to comment: Most recent file
The downloaded enclosures are not cleaned up once mapped, at which point they are duplicated. Patch adds a delete line after mapping.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 863494-4_cleanup_temporary.patch | 767 bytes | alex_b |
| feeds.deltmpfileenc.patch | 942 bytes | ekes |
Comments
Comment #1
ekes commentedComment #2
alex_b commentedGreat catch.
Reading up on the mapper and the enclosure I see that the temporary file is not only not removed, but it is downloaded, then *copied*, then not removed.
But reading field_file_save_file() I assume there is no way to avoid copying: field_file_save_file() assumes a local filepath as input that it will copy into its final place. What's more is that not using field_file_save_file() would require significant code duplication and dangerous assumptions about its internal functionality.
Otherwise, that patch is looking good. Need to apply and run tests.
Comment #3
alex_b commentedSorry, NR of course.
Comment #4
alex_b commentedThe problem with deleting the file is that right after filemapper there could be another API user calling getFile() and getFile() would return a path to a file that does not exist anymore.
Please review this approach: it deletes temporary files on __destruct().
Comment #5
ekes commentedApplied and working as expected here.
Comment #6
alex_b commentedRTBC?
Comment #7
alex_b commentedCommitted, thank you.
http://drupal.org/cvs?commit=399580
Comment #8
alex_b commentedComment #10
alex_b commentedThis patch does not interact well with #755556: Support saving local files in filefields. We will need to remove it at least as a temporary measure. See #919172: Fix enclosure source files deleted.