Download & Extend

Video Doesn't Remove Successfully

Project:Video Upload
Version:6.x-1.6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

If you upload a video and it successfully attaches to your node, and then you change your mind and want to upload a different video, when you click remove, and upload a new video, nothing will change when you update the node. The original video is still there. The only way to get rid of the original video is to remove it, then update the node. And then you can click edit and upload a new video.

Comments

#1

I'm having the same problem. I'm trying to figure out where is the problem, but I have no clue. Somebody knows whera can it be fixed.

Thanks.

#2

Can you try with the latest 1.x-dev? I'm not sure whether I committed any fixes in the meantime.

#3

I tried using the 1.x-dev latest release, and uninstalling the module, and it doesn't work yet.

#4

Could be a real bug then (or missing code that handles the use case).
I probably won't be available to take a look at this for at least 10 days...

#5

Ok, so can you tell us where is the bug, so we can change it?

#6

If I knew where the bug was, it would already be fixed :)

Now that I think of it, this is probably a filefield bug, since video_upload in 1.x doesn't do anything special to the form (it picks up the files after they're there)
Try reproducing with an ordinary filefield, and if you manage to reproduce it, post a bug there.

#7

I don't know, the problem is that video_upload (or maybe filefield) doesn't notice that the field have changed, so the status continue to synced and cron do nothing.
Thanks for all.

#8

after i posted the issue originally, i hired someone to write some custom code for me, it is a module which needs to be changed to name of your module, also node type needs to be specified, and there is some extra stuff in there about brand id, which probably should be stripped out as it doesn't relate to the youtube module...it's working on my site, and i believe i copied the function in its entirety below...perhaps the maintainer can take a look and see if this either can help provide a patch or idea on how to fix the module...

regards,

Joseph

<?php

function mymodule_custom_nodeapi(&$node, $op, $teaser, $page){
switch($op){
case 'presave':
$old_node=node_load($node->nid);
foreach (content_fields() as $field) {
     
      if ($field['widget']['module'] == 'video_upload' && $field['type_name']==$node->type) {
        $fname=$field['field_name'];
        $new_video=$node->$fname;
        $old_video=$old_node->$fname;
       
        for($i=0;$i<count($new_video);$i++){
       
        if(!empty($old_video[$i]) && $old_video[$i]['fid']!=$new_video[$i]['fid']){
       
        $new_video[$i]['video_status']='upload_pending';
        $new_video[$i]['video_id']='';
        }
        }
        $node->$fname=$new_video;
       
      }
}
break;
case 'insert':
case 'update':

if($node->type=='specifynodetypehere' && !empty($node->field_brand_id[0]['value'])){
global $user;
$brand_id=str_replace($user->uid."-U-","",$node->field_brand_id[0]['value']);
$node->field_brand_id[0]['value']=$user->uid."-U-".$brand_id;

}
break;
}
}
nobody click here