Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: ekes commentedComment #2
alex_b CreditAttribution: 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 CreditAttribution: alex_b commentedSorry, NR of course.
Comment #4
alex_b CreditAttribution: 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 CreditAttribution: ekes commentedApplied and working as expected here.
Comment #6
alex_b CreditAttribution: alex_b commentedRTBC?
Comment #7
alex_b CreditAttribution: alex_b commentedCommitted, thank you.
http://drupal.org/cvs?commit=399580
Comment #8
alex_b CreditAttribution: alex_b commentedComment #10
alex_b CreditAttribution: 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.