This is really strange. Everything worked, and all of a sudden this error shows up:

warning: Invalid argument supplied for foreach() in /home/path/sites/all/modules/colorbox/colorbox.module on line 337.

I did some update on drupal core, emfield and colorbox, today and yesterday, but this error was visible before that (i'm not sure, i didn't check recently :/), because it's indexed on Google :@

I tried to downgrade modules but nothing is changed. And colorbox popup is working, only problem I have is this warning and it's ugly to leave it as it is.
This is the site: http://msp.telekomapp.com/media/gallery/gallery-by-events/rolling-stones...

Does anyone have an idea?

Thanks!

CommentFileSizeAuthor
#1 colorbox_link_alter_999986.patch907 bytesfrjo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frjo’s picture

Assigned: vojvotkinja » Unassigned
Category: task » support
Priority: Major » Normal
FileSize
907 bytes

You should not write errors to the screen on a production site, set it to only log instead. Looks better for your users and unnecessary information is not revealed.

Have you tested stuff like clearing the cache etc?

I guess you are using the image module. The line in the error comes from the function colorbox_link_alter() that tries to add a colorbox class to the image link sizes on the image node.

You can also test this patch. It just ads a check to see if $node->images is an array or not.

vojvotkinja’s picture

Hm, I'm kinda newbie so I didn't knew about this option to turn of showing of warning messages, sweet :) I'm a little afraid to apply this patch because client will update modules and then patch will be overwritten, or am I wrong?
Thanks for your help!

Cheers!

frjo’s picture

Yes, updating a module will overwrite any changes you may have done to it.

I do not suggest you test the patch on your production site, testing should always be done on a separate testing/development/local site.

If the patch do fix the problem I could consider committing it so it will be part of the next release of the Colorbox module.

frjo’s picture

Status: Active » Fixed

Committed to 6-dev.

Status: Fixed » Closed (fixed)
Issue tags: -warning, -invalid argument, -colorbox

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