Index: webform_report.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform_report/Attic/webform_report.inc,v
retrieving revision 1.1.2.27.2.5
diff -u -r1.1.2.27.2.5 webform_report.inc
--- webform_report.inc 15 Jun 2010 18:23:22 -0000 1.1.2.27.2.5
+++ webform_report.inc 23 Jun 2010 12:55:11 -0000
@@ -508,14 +508,33 @@
// handle file type
if ($type == 'file') {
- $tmp = unserialize($raw[0]);
+
$link = ' ';
- if (!empty($tmp['filename'])) {
- $link = '' .
- $tmp['filename'] . ' (' . (int) ($tmp['filesize'] / 1024) .' KB)' .
- '';
+ $text = '';
+
+ // new file handling in webforms 6.x-3.x
+ if (function_exists('webform_get_file')) {
+ $file = webform_get_file($raw[0]);
+ if (!empty($file->fid)) {
+ $text = webform_file_name($file->filepath);
+ $link = '' .
+ $text . '' .
+ ' (' . (int) ($file->filesize/1024) . ' KB)';
+ }
}
- $out = array('data' => $link, 'field' => $cid, 'sort' => $tmp['filepath']);
+ // file handling for prior versions of webforms
+ else {
+ $tmp = unserialize($raw[0]);
+ if (!empty($tmp['filename'])) {
+ $text = $tmp['filename'];
+ $link = '' .
+ $text . '' .
+ ' (' . (int) ($tmp['filesize'] / 1024) .' KB)';
+ }
+ }
+
+ // output file column
+ $out = array('data' => $link, 'field' => $cid, 'sort' => $text);
}
// handle dates