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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | required.patch | 2.32 KB | bojanz |
Comments
Comment #1
bojanz commentedPreview ate my patch! How rude.
Comment #2
jhedstromCommitted to 1.x and 2.x. Now need to verify this isn't an issue in 7.x.
Comment #3
bojanz commentedNot an issue in 7.x