Active
Project:
Media Mover
Version:
6.x-1.0-beta9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Mar 2012 at 22:59 UTC
Updated:
20 Apr 2012 at 02:35 UTC
I have a configuration that harvests files from a particular filefield, and then moves the file to s3.
I checked the box "delete local file".
Question #1
After the file is moved to s3, the local copy gets deleted. However, it is still listed in the 'files' database table, as though it were still a local file.
Is this a bug? Once mm_s3 deletes the local file, should it also delete the entry for this file in the 'files' database table?
Question #2
After the user deletes the file, it is still listed in the 'files' table.
Is this a bug? Once the user deletes a file, should should media_mover_api delete its entry in the 'files' database table?
Comments
Comment #0.0
kobnim commentedsimplified the question
Comment #1
kobnim commentedWith regard to question #1:
I tried modifying mm_s3 to delete the entry in the 'files' table, when the local file was deleted. Specifically, inside the function mm_s3_send(), I replaced:
unlink($delete_file);with:
Unfortunately, I now get this warning message on the node-form:
Presumably, mm_s3 was doing the right thing by not deleting the entry in the 'files' table, even though the local file had been deleted.
Comment #2
kobnim commentedAgain with regard to question #1
I just thought of another reason not to delete the entry in the files table, when a file is moved to s3. Filefield uses the 'files' table to handle potential file-name collisions. For example, if a user uploads 'test.mp3', but a file with the same name (and path) was previously uploaded, then filefield renames the second file to 'test_0.mp3'. If the files on s3 were not listed in the 'files' table, then filefield wouldn't know when two different files had the same name.
Comment #3
kobnim commentedWith regard to question #2
I modified the function
media_mover_api_node_update($node), in media_mover_api.module, to delete the file-listing from the 'files' table, when the user has deleted a media-mover file.I replaced:
media_mover_api_file_delete_call($mm_file);with:
Note:
I submitted a patch that includes this fix. See http://drupal.org/node/1478246
Comment #4
arthurf commentedOn question #1
With drupal 6 this is a hard one- because the files table cannot store non-local files it presents issues. I think people have been using the option of deleting the source material when they don't want to have the file stored in the files table and the media mover files table
As per #2
Do you mean delete from the node or delete from media mover here?
Comment #5
kobnim commentedRegarding #2:
I am storing files in a multi-valued filefield. The user edits the node, deletes the file from the filefield, and then saves the node. The file the user just deleted is still listed in the 'files' table.
Does that answer your question?
Comment #6
kobnim commentedThe patch here fixes this problem: http://drupal.org/node/1478246#comment-5893866
Comment #6.0
kobnim commentedclarification