Ever since upgrading from 7.x-1.3 to 7.x-1.5, I've been constantly getting the following two error messages:

Notice: Undefined index: showinfo in youtube_colorbox_field_item_uri() (line 150 of /home/mysite/public_html/sites/all/modules/youtube/modules/youtube_colorbox/youtube_colorbox.module).

Notice: Undefined index: controls in youtube_colorbox_field_item_uri() (line 151 of /home/mysite/public_html/sites/all/modules/youtube/modules/youtube_colorbox/youtube_colorbox.module).

Comments

guschilds’s picture

Status: Active » Needs review
StatusFileSize
new952 bytes

wwwjaylee,

My apologies. I believe this can be fixed in one of two ways:

  • Visit your display settings for that field, click the gear to configure them (should see Colorbox settings) and click "Update" (the settings) and "Save" (the page)
  • Apply the attached patch. I hope to commit this (or a similar) fix to avoid these errors in the future.

Let me know how it goes. Thanks!

jay.lee.bio’s picture

Guschilds, thanks for your quick reply. Here's what I did:

1) I initially went to my display settings (which in my case is a View), but didn't save anything.

2) I decided to apply the patch instead.

3) After applying it, I played a video.

4) I went to the log and noticed that step #3 no longer causes the two original error messages, but that step #1 causes new similar error messages:

Notice: Undefined index: showinfo in youtube_colorbox_thumbnail_field_formatter_settings() (line 99 of /home/mysite/public_html/sites/all/modules/youtube/modules/youtube_colorbox/youtube_colorbox.module).

Notice: Undefined index: controls in youtube_colorbox_thumbnail_field_formatter_settings() (line 105 of /home/mysite/public_html/sites/all/modules/youtube/modules/youtube_colorbox/youtube_colorbox.module).

Notice: Undefined index: autohide in youtube_colorbox_thumbnail_field_formatter_settings() (line 111 of /home/mysite/public_html/sites/all/modules/youtube/modules/youtube_colorbox/youtube_colorbox.module).

Notice: Undefined index: iv_load_policy in youtube_colorbox_thumbnail_field_formatter_settings() (line 117 of /home/mysite/public_html/sites/all/modules/youtube/modules/youtube_colorbox/youtube_colorbox.module).

5) So I went back to step #1 and this time saved settings.

6) Finally, I went back to steps #1 & #3 and noticed that I no longer get any error messages whatsoever.

In summary, correct me if I'm wrong but I think everyone has to go through BOTH ways that you described, as each method solves its own set of problems. Whatever the case is, I'm happy now. :)

jay.lee.bio’s picture

Status: Needs review » Reviewed & tested by the community

  • guschilds committed 206e9bf on 7.x-1.x
    Issue #2431241 by wwwjaylee, guschilds: Fixed undefined index messages...
guschilds’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your quick response and attention to detail as well.

Both sets of warnings are resolved when saving the display settings for that field. Both are situations when the code is looking for the setting that has not yet been saved. This is only an issue when updating the module and not when installing from scratch. I should have been more defensive with my code and tested the module update more thoroughly. I've committed the patch from #1 to prevent anyone from experiencing these warnings when updating to future releases.

For anyone having these issues while linking a YouTube thumbnail to a colorbox:

  1. Navigate to the YouTube field's settings. For content types, that is in "Structure > Content types > manage display".
  2. Click the gear to the right of the YouTube field in question.
  3. Click "Update" under the Colorbox settings.
  4. Click "Save" at the bottom of the page.

This should prevent the errors from appearing on pages that display the thumbnail and/or its display settings.

joneldesouza’s picture

#5 worked ! thanks !!

Status: Fixed » Closed (fixed)

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