Setting a video_upload field as "required" has no effect.
Submitting a form and not uploading a video doesn't give an error message.

This is because we rely on filefield_widget(), which adds "filefield_node_form_validate" to the list of node validators.

However, that function has a check that looks like this:

if (!(in_array($field['module'], array('imagefield', 'filefield')))) continue;

$field['module'] is "video_upload" for our fields, so the validate function does nothing (video_upload_content_is_empty() is never called).

We need to make our own validate function.
Please find the patch attached. As you can see, I copied the filefield code and removed the unused parts.

CommentFileSizeAuthor
#1 required.patch2.32 KBbojanz

Comments

bojanz’s picture

StatusFileSize
new2.32 KB

Preview ate my patch! How rude.

jhedstrom’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to 1.x and 2.x. Now need to verify this isn't an issue in 7.x.

bojanz’s picture

Status: Patch (to be ported) » Fixed

Not an issue in 7.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.