On a fresh 7.21 install with only admin_menu, libraries, and colorbox modules installed. Colorbox plugin is 1.4.6. Firefox 19.0.2/Win.

Colorbox load is enabled in config. I add a colorbox-load class to a link in a node. Clicking link first time works as desired (modal size is also correct).

If I close the modal and click the link again, duplicate modals appear. Sizes of each differ, with what looks like the proper one loading behind one much larger.

My link looks like this: <a class="colorbox-load" href="/drupal-721/node/1?width=500&height=500">Google in modal!!!</a>

Looking at console (see attached screenshot), a message 'Error: cboxElement missing settings object' outputs as well as 2 calls to the path instead of just one.

colorbox-dups.jpg160.08 KBbsuttis
Members fund testing for the Drupal project. Drupal Association Learn more


bsuttis’s picture

I've found adding &iframe=true to the href fixes the issue. The docs make it seem like we should be able to choose to use an iframe or not though.

kdborg’s picture

Also getting this issue and unable to use iframe.

frjo’s picture

Category: bug » support

If you are opening another page in an modal you have no option but to use an iframe.

swickham’s picture

I was getting this issue as well. This started happening to me when I had Colorbox selected to show on "All pages except those listed". Once I changed things up to show only on specific pages and added the pages I wanted to have Colorbox to the list, it was fixed.

I'm not sure if this has something to do with how I have my templates set up or not. I checked the page source when rendered and it appears to load the same files. I stopped investigating after that though as this solution worked for me. fwiw, I was triggering the Colorbox elements by using the "colorbox-load" class.

HansKuiters’s picture

Category: support » bug

Clicking the same link once for the second time or clicking another colorbox link on the same page also gives me the modal twice. I don't use iframe. The href to show in the modal is another node. The solution from Swickham fixes this for now.

dadderley’s picture

Yup same for me.

Thanks swickham.

bluecobalt’s picture

Issue summary: View changes

Ditto. Thanks swickham.

preethivv’s picture

Thank you swickham.

Because the colobox script loaded twice, In the background and the popup.