diff options
author | Silvio <silvio@devlet.com.br> | 2011-07-27 18:02:23 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2011-07-27 18:02:23 -0300 |
commit | 72e2e8acc64bf3500084e26cc6cf2291a9e9084e (patch) | |
tree | 84c34fe1220b6a3c7fffa9227f9a15929ced08cc | |
parent | 1f2d2790eed7f5bec84e52e63dc40d46ef170150 (diff) | |
download | video-72e2e8acc64bf3500084e26cc6cf2291a9e9084e.tar.gz video-72e2e8acc64bf3500084e26cc6cf2291a9e9084e.tar.bz2 |
Additional file_load fixes for #11039427.x-1.x
-rw-r--r-- | video.field.inc | 6 | ||||
-rw-r--r-- | video.module | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/video.field.inc b/video.field.inc index c848b5e..2c26b78 100644 --- a/video.field.inc +++ b/video.field.inc @@ -117,7 +117,7 @@ function video_field_load($entity_type, $entities, $field, $instances, $langcode function video_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) { // If there are no files specified at all, use the default. foreach ($entities as $id => $entity) { - if (empty($items[$id]) && $field['settings']['default_video_thumbnail']) { + if (empty($items[$id]) && $field['settings']['default_video_thumbnail']['fid']) { if ($file = file_load($field['settings']['default_video_thumbnail']['fid'])) { $items[$id][0] = (array) $file + array( 'is_default' => TRUE, @@ -132,7 +132,7 @@ function video_field_prepare_view($entity_type, $entities, $field, $instances, $ */ function video_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) { // change the theumbnails if default is checked - if (!empty($field['settings']['default_video_thumbnail'])) { + if (!empty($field['settings']['default_video_thumbnail']['fid'])) { foreach ($items as $delta => $item) { if ($item['use_default_video_thumb']) $items[$delta]['thumbnail'] = $field['settings']['default_video_thumbnail']['fid']; @@ -483,4 +483,4 @@ function video_thumbnail_validate($element, &$form_state) { $file = file_save($file); // $element['#value'] = (array) $file; } -}
\ No newline at end of file +} diff --git a/video.module b/video.module index bc5aa2f..36c630f 100644 --- a/video.module +++ b/video.module @@ -211,8 +211,8 @@ function video_thumb_process(&$element, &$form_state) { } // Setup our large thumbnail that is on the left. // @todo Add smaller video preview instead of thumbnail? - if (isset($file['thumbnail']) && !empty($file['thumbnail'])) { - $large_thumb = file_load($file['thumbnail']); + if (isset($file['thumbnail']) && !empty($file['thumbnail']['fid'])) { + $large_thumb = file_load($file['thumbnail']['fid']); } elseif (!empty($field['settings']['default_video_thumbnail']['fid'])) { $large_thumb = file_load($field['settings']['default_video_thumbnail']['fid']); @@ -750,4 +750,4 @@ function _video_object_to_array($data) { return $result; } return $data; -}
\ No newline at end of file +} |