Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This was first reported in the 7x-2.9 update, but it's still happening for the 7x-2.13 update.
https://www.drupal.org/node/2514770 (7x-2.9)
https://www.drupal.org/node/2594167 (7x-2.10)
Basically, if you're using a colorbox trigger, the image doesn't even render at all.
@jmsosso suggested that the bug came from this code snippet (/views/colorbox_handler_field_colorbox.inc)
// Return nothing if popup is empty.
if (empty($popup)) {
return;
}
If I understand correctly, the empty() function would remove $popup instead of checking if $popup is emtpy. So by removing $popup, it always returns empty.
Comments
Comment #2
DrupalDude777 CreditAttribution: DrupalDude777 commentedThis is from php.net : http://php.net/manual/en/function.empty.php
"Description ¶
bool empty ( mixed $var )
Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value equals FALSE. empty() does not generate a warning if the variable does not exist."
So actually the empty is to check if the variable $popup contains something.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous at Cheeky Monkey Media commentedI've set up a basic site with only colorbox, no other javascript libraries to showcase the colorbox trigger field working.
https://live-colorbox7.pantheonsite.io/colorbox-trigger
The view is fairly simple, using an image field (thumbnail) as the trigger field, and displaying the same image (original), and the body in the popup.
This is working fine with when there aren't any other modules used for the view display.
My best guess that if things aren't working with your view, some other module or library is causing a conflict.
Could you provide a bit more information about what is being used for your trigger field so I can try to duplicate that a bit more accurately.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous at Cheeky Monkey Media commentedComment #5
oadaeh CreditAttribution: oadaeh at Hook 42 commentedI'm closing this as a duplicate of #2594167: Views using colorbox trigger fail to load images.
@vchen, you should not open duplicate issues, but continue the conversation in the other issue.