aboutsummaryrefslogtreecommitdiff
path: root/plugins/video_upload
diff options
context:
space:
mode:
authorFabio Varesano <fax8@13637.no-reply.drupal.org>2006-09-18 23:10:59 +0000
committerFabio Varesano <fax8@13637.no-reply.drupal.org>2006-09-18 23:10:59 +0000
commitd7b1524caa8aa292df7dfea0bead120df68ea5cb (patch)
tree7e4788f6db769d9e74a7995659b857c5dcaeb1c2 /plugins/video_upload
parentcf552cda168ad0c9bcf70df09c25d24e3658c792 (diff)
downloadvideo-d7b1524caa8aa292df7dfea0bead120df68ea5cb.tar.gz
video-d7b1524caa8aa292df7dfea0bead120df68ea5cb.tar.bz2
Patch #83233 by Robrecht Jacques (http://drupal.org/user/22598):
video doesn't work together with db_rewrite_sql well: use "join on" instead of "where table1, table2" to be db_rewrite_sql compatible Bug #82365 reported by moshe weitzman (http://drupal.org/user/23): "You have to insert a valid file size for this video." - video_upload.module Solved a little error wich always ask to put a size even if the video was uploaded.
Diffstat (limited to 'plugins/video_upload')
-rw-r--r--plugins/video_upload/video_upload.module8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/video_upload/video_upload.module b/plugins/video_upload/video_upload.module
index 7b60ef4..e467d7e 100644
--- a/plugins/video_upload/video_upload.module
+++ b/plugins/video_upload/video_upload.module
@@ -63,6 +63,8 @@ function video_upload_nodeapi(&$node, $op, $teaser) {
$output['video_upload_file'] = _video_upload_load($node);
if($node->vidfile == '') { // we will disable uploaded file if a path is already live
$output['vidfile'] = file_create_url($output['video_upload_file']->filepath);
+ // set the filesize - this seems not to work.. why???
+ $output['size'] = $output['video_upload_file']->filesize;
}
return $output;
@@ -181,11 +183,17 @@ function _video_upload_prepare(&$node) {
file_check_directory($temppath, TRUE);
$node->video_upload_file = file_save_upload($file, $temppath .'/'. $file->filename, FILE_EXISTS_REPLACE);
$node->video_upload_file->newfile = TRUE;
+
+ // set video size
+ $node->size = $node->video_upload_file->filesize;
$_SESSION['video_upload_file'] = $node->video_upload_file;
}
else if (!empty($_SESSION['video_upload_file'])) {
$node->video_upload_file = $_SESSION['video_upload_file'];
+ // set video size
+ $node->size = $node->video_upload_file->filesize;
+
} else {
$_SESSION['video_upload_file'] = $node->video_upload_file;
}