Undefined index: autoplay, enablejsapi, loop, modestbranding
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 33
Undefined index: enablejsapi
media_youtube_preprocess_media_youtube_video(
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 37
Undefined index: loop
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 52
Undefined index: rel, showinfo
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 58
Undefined index: theme
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 68, 69
Undefined index: color
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 71, 72
Undefined index: autohide
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 74, 75
Undefined index: nocookie
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 79
Undefined index: protocol_specify
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 86
Undefined index: width, height
media_youtube_preprocess_media_youtube_video()
sites/all/modules/media_youtube/includes/themes/media_youtube.theme.inc
line 95
Comment | File | Size | Author |
---|---|---|---|
#8 | media_youtube-1884484-8-set-defaults.patch | 1019 bytes | mikeytown2 |
#3 | media_youtube-1884484-3-fix-notices.patch | 4.06 KB | mikeytown2 |
#1 | media_youtube-1884484-1-fix-notices.patch | 3.13 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedComment #2
RobW CreditAttribution: RobW commentedThanks for the patch. Can you tell us how to reproduce the errors?
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedhappens on node/add and node/*/edit pages according to the logs. It does not happen for me so it seems to only happen to certain users. Updated patch to take care of the missing width and height.
Comment #4
RobW CreditAttribution: RobW commentedHmm, this is interesting.
Sorry, of course I was thinking of!empty()
isn't going to work, because if something is set to 0 or false it's not empty and it shouldn't trigger the conditional.isset()
. It sounds like$variables['option']
isn't coming through for some users. Is it possible you're overwriting that array with a preprocess? Or maybe the ctools defaults for the variables aren't getting through. If you can give some more info to reproduce maybe we can fix the source of the problem.Comment #5
mikeytown2 CreditAttribution: mikeytown2 commented!empty() will actually work. If something was set to 0 or false it would be skipped in the old logic, and it will be skipped with the new logic as well.
if
$variables['options'][$option] = 0
both if statements will be skipped.I've put in some debugging code to capture the $variables variable when this happens.
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedDid some digging, this is the source of the issue for me
http://drupal.stackexchange.com/questions/18363/given-a-file-id-fid-how-...
Do you have a good idea on how to load the options in if the only thing given is the file id?
Comment #7
RobW CreditAttribution: RobW commented#5, totally right.
#6, I've come across that before, don't know how I worked around it. I'll take a look and ask some compatriots -- I'd rather figure out how to fix that issue than add
!empty()
checks to every options check.Comment #8
mikeytown2 CreditAttribution: mikeytown2 commentedWhat if we added in the defaults to the options?
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedBetter idea would be to use media_youtube_file_formatter_info(); correct?
Edit: I've updated the code example on stack exchange to load file_info_formatter_types's default_settings into the $options key when getting passed to drupal_render.
Comment #10
RobW CreditAttribution: RobW commentedThanks for really digging into this. The variables are all stored in media_youtube.variables.inc, so there shouldn't be a need to redeclare them, which it looks like you figured out already. The code sample you've given looks good, although there should be a way to load the settings off of the specific formatter chosen as opposed to the defaults.
You might want to ask in the Media queue as well -- I think it's a good bet someone has run into a similar issue before.
Let me know what you come up with. I'd like to include it in the next revision of the readme.