Hi. I'm receiving the following #validators "Notice" in the media_youtube browser (i.e. iframe pop-up):
Notice: Undefined index: #validators in media_youtube_add_validate()
STEPS:
1. In my content type, click "Select media" button (iframe browser opens)
2. Enter "search" terms and click apply (or press return)
3. Click on video thumbnail and press "submit"
4. Browser is refreshed and Notice appears at top, along with normal "name" field, selected video thumbnail and "save" button.
While I can proceed to ignore the notice and successfully save the file with my node, this message seems to indicate a larger issue in media_youtube->media_youtube_add_validate().
I attempted to utilize the following patch, but the Notice remains:
http://drupal.org/files/media-youtube-add-api-id-1730746-5.patch
I'm working with the following module versions:
Media 7.x-2.0-unstable+39-dev
Media_YouTube 7.x-2.0-rc1+2-dev
File_Entity 7.x-2.0-unstable6+13-dev
Here is the suspected code snippet from the method:
$validators = $form['#validators'];
if ($validators) {
// Check for errors. @see media_add_upload_validate calls file_save_upload().
// this code is ripped from file_save_upload because we just want the validation part.
// Call the validation functions specified by this function's caller.
$errors = file_validate($file, $validators);
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | media_youtube-undefined_index_validators-1822162-2.patch | 555 bytes | rooby |
Comments
Comment #1
RobW commentedComment #2
rooby commentedThis also happens in latest dev.
The error message I am getting is
This patch fixes it for me.
Comment #3
flying dutchman commentedSubscribing & trying patch
Comment #4
aaron commentedI am unable to reproduce this. However, the patch itself seems innocuous enough.
Comment #5
pfaocleExperiencing this by following same steps as in opening issue.
- Media 7.x-2.0-unstable7
- Media_YouTube 7.x-2.0-rc2
- File_Entity 7.x-2.0-unstable7
Patch applies cleanly & fixes the warning.
Comment #6
aaron commentedCommitted to http://drupalcode.org/project/media_youtube.git/commit/fb6f652.
Comment #8
avpaderno