Video module has a function called video_field_validate

In that function the only validation that takes place is:

$validators = file_field_widget_upload_validators($field, $instance);

Then iterating through that array. Since the file field already runs these validators this entire function is unnecessary. The problem is the function runs validators that are implicitly unset in some situation such is the case with this issue in the filefield_sources module: https://drupal.org/node/938348.

Is their another purpose to this function other than running these validation functions that have already been run by the file field parent?

I don't fully understand how all the field api stuff works but I do know all the checks run by this function are being run twice.

Comments

Poieo’s picture

Version: 7.x-2.10 » 7.x-2.x-dev

I can validate this issue. When using filefield sources, the video module attempts to re-validate against file limits that are purposefully ignored by filefield sources.

nattiecakes’s picture

I'm having this same problem. I'm limited to 64MB post max, so I upload videos via FTP and try to attach them via FileField_Sources. Unfortunately, there is no proper override of the file size so I cannot get it to accept a video of any decent size. It was already fairly frustrating to have to download and configure FileField_Sources to begin with, so is there perhaps some way that the Video module itself could have its own method of allowing FTPed files?

heshanlk’s picture

Component: Video Field » General
Status: Active » Closed (cannot reproduce)
morenstrat’s picture

Status: Closed (cannot reproduce) » Active

I can reproduce this error with the filefield sources module, a video file that is larger than the upload limit and *not* being user 1.

@heshanlk: let me know if you need further information to reproduce this.

donbon’s picture

One might be able to "fix" this issue by commenting out the line that @danielphenry mentioned:

/* $validators = file_field_widget_upload_validators($field, $instance); */

PhilippVerpoort’s picture

I can also confirm this error with the filefield sources module, a video file that is larger than the upload limit, and being logged in as any user (uid == 1 or uid > 1).

I am using:

* video 7.x-2.11
* filefield sources 7.x-1.10

The change that @donbon recommended fixed the problem for me.

marabak’s picture

Video extends FileItem and FileItem has this extension and file size validations that are called by the FileValidationConstraintValidator regardless to form widget settings..