I'm getting this notice when viewing a node where the YouTube field is empty:
Notice: Undefined index: und in youtube_tokens() (line 387 of youtube.inc)
The node display is controlled by Panels, using a "Node being viewed" content pane... not sure if that's relevant.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | youtube-undefined_index_und_in_youtube_tokens-2653920-3.patch | 1.92 KB | alan-ps |
Comments
Comment #2
markabur commentedI'm also seeing this notice pointing at line 395 rather than line 387:
Notice: Undefined index: und in youtube_tokens() (line 395 of youtube.inc)Comment #3
alan-ps commentedWe should check whether some value exists in a field for next tokens: youtube_video_url, youtube_image_url.
I added a patch which adds necessary checks.
Comment #4
markabur commentedThanks, patch works for me!
It also fixes #2653922: Notice: Undefined property: stdClass::$data in youtube_get_remote_image() (line 123 of youtube.inc).
Comment #8
guschilds commentedThanks for the patch and testing.
I was able to confirm the bug existed and committed the patch to the 7.x-1.x branch. Another commit replaces the token with an empty string if the field didn't have a value. I also confirmed that tokens were improperly replaced in the 8.x-1.x branch when the field doesn't have a value. I ported the patch to that branch and committed it there as well.