Closed (fixed)
Project:
Upload File Replace (for filefield CCK)
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2009 at 11:53 UTC
Updated:
14 Nov 2011 at 07:38 UTC
When I try to replace the file with newer version of it (with same name), the file in filefield have wrong filename and dead link.
How to reproduce:
1. Upload a file to a filefield (for example, "test2.txt")
2. Save the node
3. Go to edit form
4. Press "Remove" in filefield
5. Upload file "test2.txt" again
6. Press Save.
After that in folder I see file "test2_0.txt" and "test2.txt" is deleted, but in node I see the link to file "test2.txt" that isn't exists.
If I press "Save" and after that - "Edit" between 4 and 5 steps, all works good.
Comments
Comment #1
markDrupal commentedI'm not able to reproduce this error. This is the basic functionality of the module and it works when I tried it.
You should check your temp file directory "admin/settings/file-system" and see if the file gets moved there. It is possible that the file gets moved to the temp directory but you don't have permissions to write or read the temp directory. Again, it should fail with an error, so I'm not sure what is happening for you.
Comment #2
markDrupal commentedComment #3
murzIt is reproducible for me on latest version with fresh site with installed modules:
Drupal core modules 6.14
CCK 6.x-2.5
Upload replace 6.x-1.0
All other modules is off.
Algoritm to reproduce:
1. Create new node with filefield field (number of files - 1).
2. Upload file "test4.txt" to filefield.
3. Save the node.
You see the correct link to the file:
files/test2/test4.txt5. Press "Edit" on this node.
6. Press "Remove" button on filefield.
7. Press "Browse" button and select "test4.txt".
8. Press "Upload". In widget you will see the link:
files/test2/test4_0.txtThis link is works normally.
9. Press "Save" button for node.
10. Look at the link in filefield - it becomes:
files/test2/test4.txtbut this link is broken, file is stillfiles/test2/test4_0.txtin filesystem!Comment #4
murzComment #5
markDrupal commentedThanks, I found the problem with sites with revisioning disabled.
Adding a hook_file_delete allowed me to update the file path before the delete occurs.
Anyways I was able to fix this issue and committed to 1.1
Comment #7
sidharthapI tried with the above solutions but no result. same problem occurs.