Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
On a clean install upload.module enabled:
- Create a new story
- Attach a file
- Save the story
- Edit the story
- Check the delete checkbox
- Save the node
The file is removed from the node, but it remains in the file table (with a status of '1') and on disk.
Comment | File | Size | Author |
---|---|---|---|
#6 | upload_173305_3.patch | 1.17 KB | drewish |
#5 | upload_173305_2.patch | 1.43 KB | drewish |
#4 | upload_173305_1.patch | 1.43 KB | drewish |
#3 | upload_173305_0.patch | 1.21 KB | drewish |
#1 | upload_173305.patch | 937 bytes | drewish |
Comments
Comment #1
drewish CreditAttribution: drewish commentedyup, looks like we're missing a call to file_delete().
Comment #2
webernet CreditAttribution: webernet commentedThis deletes the files, but leaves the entries in the files table.
Comment #3
drewish CreditAttribution: drewish commentedright you are. this also checks that the file isn't used in a different revision.
Comment #4
drewish CreditAttribution: drewish commentedwebernet pointed out that {file} should be {files}, also now using $fid consistently.
Comment #5
drewish CreditAttribution: drewish commentedforgot to remove my debugging code.
Comment #6
drewish CreditAttribution: drewish commentedthis is the right patch... for real... i swear.
Comment #7
webernet CreditAttribution: webernet commentedWorks fine.
Comment #8
Gábor HojtsyAny other node could now use the same file, or not? This is not only about revisions, right? Let's get the comment right!
Comment #9
drewish CreditAttribution: drewish commentedthat comment is correct. it only needs to worry about the file being attached to other versions of the same node.
Comment #10
Gábor Hojtsywhy?
Comment #11
drewish CreditAttribution: drewish commentedbecause that's the way the module works... attach a file to a node and it generates a new fid which is shared between multiple revisions of a node. files aren't shared between nodes, dopry and i had worked on allowing that type of thing but it didn't make it in before the freeze.
Comment #12
Gábor HojtsyAh, all right, seems like I don't have an actual picture on the upload module. This patch committed then, thanks.
Comment #13
(not verified) CreditAttribution: commented