From a31b9883849b0a04420ee1d476fbe08c87bc5d53 Mon Sep 17 00:00:00 2001 From: Heshan Date: Wed, 16 Mar 2011 10:58:16 +0530 Subject: Fixed the dependencied with the Media module. --- includes/transcoder.inc | 5 +++++ video.module | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/transcoder.inc b/includes/transcoder.inc index bdb447a..019168b 100644 --- a/includes/transcoder.inc +++ b/includes/transcoder.inc @@ -59,6 +59,11 @@ class video_transcoder { $vid = $video['fid']; $thumbs = $this->transcoder->generate_thumbnails($video); foreach ($thumbs as $file) { + // media module is altering file_manged table with type, so if we do not consider about is then we might get entity load issue. + // #1015580 + // if media module exists add type as an image + if (module_exists('media')) + $file->type = 'image'; $existing_file = file_load_multiple(array(), array('uri' => $file->uri)); if ($existing_file) // check thumbnail file exists $file = (array) $existing_file; diff --git a/video.module b/video.module index 4beee74..d7f180b 100644 --- a/video.module +++ b/video.module @@ -239,8 +239,8 @@ function video_thumb_process(&$element, &$form_state) { // @todo Add smaller video preview instead of thumbnail? if (isset($file['thumbanail']) && !empty($file['thumbanail'])) { $large_thumb = file_load($file['thumbanail']); - } elseif (!empty($field['settings']['default_video_thumbnail'])) { - $large_thumb = file_load($field['settings']['default_video_thumbnail']); + } elseif (!empty($field['settings']['default_video_thumbnail']['fid'])) { + $large_thumb = file_load($field['settings']['default_video_thumbnail']['fid']); } else { // $large_thumb = file_load($default_thumb); } -- cgit v1.2.3