Downloading private files form submissions doesn't work properly.

webform_file_download checks whether $file->sid is empty and then uses $row->sid to load the submission.

Below code fixes this problem:

@@ -1003,7 +1003,7 @@ function webform_file_download($uri) {
if ($row) {
$file = file_load($row->fid);
}
- if (!empty($file->sid)) {
+ if (!empty($row->sid)) {
$submissions = webform_get_submissions(array('sid' => $row->sid));
$submission = reset($submissions);
}

Comments

quicksketch’s picture

Status: Active » Needs review

Yikes, thanks @dirkgomez. Not sure how that passed my testing.

quicksketch’s picture

Status: Needs review » Fixed

Thanks, committed your change to the D7 branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.