Notice: Undefined index: field_name in theme_colorbox_image_formatter() (line 117 of \site\sites\all\modules\contributed\colorbox\colorbox.theme.inc).
I'm using version 7.x-2.8 of Colorbox module.
I have page with the images inserted to the content through media module. Also I'm using entity_view_mode to set wysiwyg view mode for images.
For image file type I had the next settings for colorbox (admin/structure/file-types/manage/image/file-display/wysiwyg):
Gallery (image grouping) : Per field in page gallery.
Then from code I figure out, that I should have used Per page gallery option, but anyway it is bug, because the $field = $variables['field']; in this case always empty.
Comments
Comment #1
lukevanblerk commentedPatch attached for a fix which checks if field_name has a value before using to determine the $gallery_id.
Comment #2
spgd01 commentedI can confirm the patch works on the latest Dev: 7.2.10+6-dev
Comment #3
spgd01 commentedOk this works but it removes the navigation from the image pop up so you cannot go to the next or previous image.
Comment #4
lobsterr commented$gallery_id cannot be empty. So, I have assigned the default value for such cases.
Comment #6
lobsterr commentedReuploaded the same patch, just renamed interdiff
Comment #7
renatog commentedLooks good.
Thank you very much people.
Comment #9
renatog commentedFixed.
Commited in dev branch.
Thank you very much for contribution people.
Good Work.
Regards.