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

lukevanblerk’s picture

Version: 7.x-2.8 » 7.x-2.9
StatusFileSize
new640 bytes

Patch attached for a fix which checks if field_name has a value before using to determine the $gallery_id.

spgd01’s picture

Version: 7.x-2.9 » 7.x-2.x-dev

I can confirm the patch works on the latest Dev: 7.2.10+6-dev

spgd01’s picture

Ok this works but it removes the navigation from the image pop up so you cannot go to the next or previous image.

lobsterr’s picture

Status: Active » Needs review
StatusFileSize
new572 bytes
new670 bytes

$gallery_id cannot be empty. So, I have assigned the default value for such cases.

Status: Needs review » Needs work

The last submitted patch, 4: interdiff-2445863-1-4.patch, failed testing.

lobsterr’s picture

Status: Needs work » Needs review
StatusFileSize
new670 bytes
new572 bytes

Reuploaded the same patch, just renamed interdiff

renatog’s picture

Assigned: Unassigned » renatog
Status: Needs review » Reviewed & tested by the community

Looks good.

Thank you very much people.

  • RenatoG committed f62e7ab on 7.x-2.x authored by lukevanblerk
    Issue #2445863 by LOBsTerr, lukevanblerk, spgd01, RenatoG: Undefined...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Fixed.

Commited in dev branch.

Thank you very much for contribution people.

Good Work.

Regards.

Status: Fixed » Closed (fixed)

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