From 794aa2d5c3f67ba94d60a36fc922ea6308ae6f02 Mon Sep 17 00:00:00 2001 From: glen201 Date: Fri, 24 Jul 2009 01:10:42 +0000 Subject: #518396 by decibel.places : "Video type not supported" video_upload.module, fixed rebuilding derivative images when video updated #502606 by glen201 : Permissions error in Video Image module prevents users from uploading image thumbnail, fixed #495886 by glen201: Autogenerated thumbnail sticks and is not replaceable by new video/image uploaded, fixed dependency on Image module Enhanced video_upload module to fix files left behind after delete video Enhanced video_upload module to prevent error when replacing ffmpeg converted video with video that will not be auto-converted --- plugins/video_image/video_image.module | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'plugins/video_image/video_image.module') diff --git a/plugins/video_image/video_image.module b/plugins/video_image/video_image.module index f8a3efb..db06d77 100644 --- a/plugins/video_image/video_image.module +++ b/plugins/video_image/video_image.module @@ -7,6 +7,7 @@ * @author Fabio Varesano * porting to Drupal 6 * @author Heshan Wanigasooriya + * @author Glen Marianko Twitter@demoforum * @todo */ @@ -44,6 +45,8 @@ function video_image_menu() { /** * Implementation of hook_perm */ +//GMM: define positions in perm array to reference later (without misspellings :) + define('OVERRIDE_IMAGE', 0); function video_image_perm() { $array = array('override autothumbnailing using uploaded image'); return $array; @@ -152,9 +155,9 @@ function video_image_form_alter(&$form, &$form_state, $form_id) { } $auto_thumbable = video_image_is_autothumbable($node); - - if(!$auto_thumbable || user_access('override autothumnailing using uploaded images')) { - // let's be sure that image directories are ready + //GMM: fix permission misspelling + $perm=video_image_perm(); + if(!$auto_thumbable || user_access($perm[OVERRIDE_IMAGE])) { // let's be sure that image directories are ready if (function_exists('_image_check_settings')) { _image_check_settings(); } @@ -328,8 +331,13 @@ function _video_image_submit(&$node) { $image = _video_image_temp_image_load(array_values($node->tempimage['fids'])); //print_r($image); //exit; - db_query("DELETE FROM {files} WHERE fid in (%s)", - implode(',', array_values($node->tempimage['fids']))); + + //GMM: This DELETE query causes the uploaded video file to disappear + // especially when using ffmpeg to convert the video - no need to kill the + // tempimage, since its status is 0 in {files} Drupal cron will nix it + //db_query("DELETE FROM {files} WHERE fid in (%s)", + // implode(',', array_values($node->tempimage['fids']))); + // initialize standard node fields //print_r($image); //exit; @@ -348,7 +356,10 @@ function _video_image_submit(&$node) { $oldimage->images = $image->images; // delete the old images? - $oldimage->new_image = 1; + //GMM: Fix to use the proper variable to trigger current Image module to rebuild derivative images + // Tested against Image 6.x-1.0-aplha4 + // $oldimage->new_image = 1; + $oldimage->new_file = true; node_save($oldimage); $node->iid = $oldimage->nid; $node->serial_data['iid'] = $node->iid; -- cgit v1.2.3