Hey there,
was just trying some things out, namely editing a webform and replacing one file with another and ran into a couple of issues which apparently come from the following code in the _webform_submit_file function components/file.inc
// Delete any previous files.
if ($value['_old'] && ($existing = webform_get_file($value['_old']))) {
file_delete($existing->filepath);
db_query("DELETE FROM {files} WHERE fid = %d", $existing->fid);
}
Main issues here are:
1. file_delete in D7 takes the file object (in this case $existing) and not the filepath attribute (which actually doesn't exist anymore so that throws the first error)
2. the 2nd query is both invalid syntactically and also meaningless, as the files table doesn't exist in D7 anymore.
As I don't know exactly all the stuff that happens behind the scenes, I would dare to post a patch, but I assume you guys have enough to fix this up ;)
Cheers!
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform_file_delete-d7.patch | 501 bytes | quicksketch |
Comments
Comment #1
quicksketchThanks! This is an easy fix since file_delete() now deletes the record for us. Committed attached patch.