When working with the "Page Manager" in the CTools suite, and setting "Selection Rules" for a new Panel variant, colorbox seems to have interfered with modal windows.

To reproduce this

  1. Install Drupal 7
  2. Install Ctools (DEV)
  3. Install Panels (DEV)
  4. Install Colorbox
  5. Go to the "Page Manager"
  6. Edit a standard page type, e.g. "Node Pages"
  7. Create a variant
  8. In "Selection Rules" add a rule
  9. Try to set rule criteria
  10. Watch the Panels modal hang indefinitely

What suggested Colorbox caused it

I turned OFF the Colorbox module, and went back to Step 5 above.

Comments

wjaspers’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2

Whoops, realized I marked the wrong version #.

merlinofchaos’s picture

The reason for this seems to be that colorbox javascript does not protect itself from the library not being installed.

If the library is not installed, it attempts to run colorbox, which crashes and breaks any other javascript that may be running at the time.

Inserting this into various behaviors fixes the problem. I put this in colorbox.js inside the attach function right away, and it prevented the interference.

    if (!$.isFunction($.colorbox)) {
      return;
    }
wjaspers’s picture

Awesome, seems to resolve it. As always Merlin, you rock.

frjo’s picture

Status: Active » Fixed

Thanks to @merlinofchaos for the example how to protect from the library not being installed. I have committed it to 7-dev.

Status: Fixed » Closed (fixed)

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