When a user submits a video that doesn't have have a file selected for upload and hasn't entered a path to a file in the other field, when i try to view the node it doesn't load, and if you go to another pages you see a lot of "video type not supported" messages, one after the other. So as far as i can tell, because neither field is a required one, when a video is created with neither of those fields filled out, when the node is viewed it tries to display the "video type not supported message" but gets stuck in a never ending loop, so the page doesn't show.

Is there a way to make sure that at least one of them are filled out when a video is submitted without requiring one or the other or both? Or is there a way to have it not get stuck in an endless loop when a video node with no video set for ether is viewed?

Comments

codewatson’s picture

After looking a bit more at the video.module code, the path to file starts off required, but once the upload video plugin (video_upload.module) is enabled it is changed to not required, which makes sense, but that also means that if someone submits a video without uploading a video or giving it a path, it is allowed to go through, and then when you view the video you get the "video type not supported" messages in an endless loop (the longer you let the page try to load, the more messages it creates, hench the endless loop)

macclick’s picture

Safari and firefox get this error on my server.
Safari wont upload video.

changed to Firefox it does upload the video but it does not play back and gets same error, Down loads also not working getting error with per missions /files/ even though I have set per missions to 777.

codewatson’s picture

Category: support » bug
Priority: Normal » Critical

My problem is not a matter of a video not uploading, but of a user not even selecting a video to upload and then submitting the form. Your problem is related though, because while you are having problems with it uploading, the form is still submitted with no video that it is pointing to, and for some reason this causes an endless loop, this is a coding problem, not a browser type problem.

Changed to bug report, because this seems like it is becoming more of a bug.

codewatson’s picture

Status: Active » Needs review

Its amazing how one small line of code can cause an endless loop. After looking throughout the video.module i found out why it was getting stuck in an endless loop. There is a switch statement that checks what format the video is in, and if it doesn't find one, it sends the "Video type not supported message" and then it tries to load the node again. I see the reasoning for this, if you have the play tab enabled this would work fine, but since i don't, the video is part of the node, and so it just gets stuck doing the same thing over and over.

I'm not going to put a patch out because it only happens when the play tab is disabled and i don't know how to fix it to work with the tab enabled, i also don't know how to generate a patch!

However, if you are getting the same as me, heres the code that will fix it:

Right around line 947 of the video.module file (yours may be different, i've made slight modifications to mine) you have this switch statement:

switch (_video_get_filetype($node->vidfile)) {
    case 'divx':
      return theme('video_play_divx', $node);
    case 'mov':
    case 'mp4':
    case '3gp':
    case '3g2':
      return theme('video_play_quicktime', $node);
    case 'rm':
      return theme('video_play_realmedia', $node);
    case 'flv':
      return theme('video_play_flash', $node);
    case 'swf':
      return theme('video_play_swf', $node);
    case 'dir':
    case 'dcr':
      return theme('video_play_dcr', $node);
    case 'wmv':
      return theme('video_play_windowsmedia', $node);
    case 'ogg':
      return theme('video_play_ogg_theora', $node);
    case 'youtube':
      return theme('video_play_youtube', $node);
    case 'googlevideo':
      return theme('video_play_googlevideo', $node);
    default:
      drupal_set_message('Video type not supported', 'error');
      drupal_goto("node/$node->nid");
      break;
  }

All you need to do is comment out or delete the drupal_goto("node/$node->nid"); line right near the bottom of that code.

If someone can figure out how to fix this so that it works with both the play tab enabled and disabled, then that would be great.

fax8’s picture

Status: Needs review » Fixed

fixed in the upcoming rewrite.

Thanks!

Fabio

Anonymous’s picture

Status: Fixed » Closed (fixed)