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()

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:

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);




RobW’s picture

Title:#validators notice appearing in media_youtube browser» YouTube tab: #validators notice appearing in media_youtube browser
rooby’s picture

Title:YouTube tab: #validators notice appearing in media_youtube browser» Undefined index: #validators notice appearing when adding a video
Version:7.x-2.0-rc1» 7.x-2.x-dev
Status:Active» Needs review
555 bytes

This also happens in latest dev.

The error message I am getting is

Notice: Undefined index: #validators in media_youtube_add_validate() (line 274 of /var/www/mysite/sites/all/modules/contrib/media_youtube/media_youtube.module).

This patch fixes it for me.

flying dutchman’s picture

Subscribing & trying patch

aaron’s picture

Status:Needs review» Reviewed & tested by the community

I am unable to reproduce this. However, the patch itself seems innocuous enough.

pfaocle’s picture

Experiencing 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.

aaron’s picture

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

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