Lightbox Plus Colorbox
Cannot read property 'rel' of undefined (2 posts)

  1. richieboo
    Posted 2 years ago #


    My error-
    Uncaught TypeError: Cannot read property 'rel' of undefined

    Not working for me. I have tried changing themes, disabling all other plugins, and changing settings like where to load (header vs. footer), force html5, etc. Nothing.

    I check the console log and after I click a picture I get the following error. Note: there is nothing in the Link Rel setting of the picture.

    I did notice that this plugin, when activated, breaks another plugin I am using, "Awesome Flickr Gallery", shown on this page:
    http://richiemadden.com/2009/06/new-bamboo-garden-arrow-bamboo/ so with that I cannot leave it enabled right now.

    I would love to get them both to play nice together but perhaps someone else has determined that these two plugins cause a conflict and then I can stop wasting time trying to get this to work.

    Any and all help much appreciated.

    WordPress Information

    WordPress Version: 3.5.1
    jQuery Version: 1.8.3
    Server Information

    Site URL: http://richiemadden.com
    PHP Version: 5.3.10
    Server Software: Apache
    Plugin Information

    Lightbox Plus ColorBox Version: 2.6
    LBP Shortcode Version: 3.5
    ColorBox Version: 1.3.32
    Simple PHP HTML DOM Parser Version: 1.5 Rev: 202
    Client Information

    Browser: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
    Viewport: 1903x1072
    Platform: Win32
    Javascript: Yes


  2. tzdk
    Posted 2 years ago #

    Problem could be this http://richiemadden.com/wp-content/plugins/awesome-flickr-gallery-plugin/colorbox/jquery.colorbox-min.js Flickr gallery load an outdated version of Colorbox also used by Lightbox. 2 of them is 1 too many. However, if you deselect Colorbox in Flickr it should not load.


    [BUG FIX] Do not include Colorbox script if it is not enabled.

    See "Slideshow behavior" under "Gallery Settings" http://s.wordpress.org/extend/plugins/awesome-flickr-gallery-plugin/screenshot-4.png

    There could be other conflicts but this seem like an obvious one and you did not say this is not relevant :)

    What is weird is that you have both Colorbox and the alternative script Highslide.js loadet. Must be a bug if you use latest version.

    Colorbox dev. has gone crazy with updates lately https://github.com/jackmoore/colorbox#changelog so this Ligthbox is also behind the times but for understandable reasons. Flickr Galllery dev. is behind for real. Plugins/Themes using external scripts but then do not bother to update them, while they do make "normal" updates set off my dev. alarms. Never a good sign.

    AAaaarg, I leave above idea but I think your issue is wrong load of jQuery

    First problem:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

    Which is fine but where is migrate.js? Old Colorbox is not compatible with jQuery 1.9.1, why you get errors I bet.

    http://jquery.com/download/ They are twins! WordPress 3.6 will also come with both.

    Funny that Google does not host migrate.js, more stupid than funny.

    Second problem:

    You ALSO load default jQuery 1.8.3 from WordPress.


    Well you can remove that line with Google and at least you know default will be there.

    Or you can remove line with Google and go with CloudFlare CDN instead

    add_action( 'wp_enqueue_scripts', 'jqueryfix' );
    function jqueryfix() {
    	wp_deregister_script( 'jquery' );
    	wp_enqueue_script( 'jquery', 'http://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js', array(), NULL, FALSE );
    //	wp_enqueue_script( 'jquery-migrate', 'http://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/1.1.1/jquery-migrate.min.js', array(), NULL, FALSE );

    May dual Colorbox setup will work but only may be, why I left initial idea. Includes nagging Flickr Gallery dev. to get with the times and fix possible Colorbox load bug.

    Hmm, may be you can leave Colorbox enabled in Flickr Gallery but then deregister script itself. Is already available from Lightbox.

    You can try

    add_action( 'wp_enqueue_scripts', 'unload_colorbox_flickrgal' );
    function unload_colorbox_flickrgal() {
        wp_deregister_script( 'afg_colorbox_script' );
    //    wp_deregister_style( 'afg_colorbox_css' );

    Actually "deque" might be more correct

    add_action( 'wp_enqueue_scripts', 'unload_colorbox_flickrgal' );
    function unload_colorbox_flickrgal() {
        wp_dequeue_script( 'afg_colorbox_script' );
    //    wp_dequeue_style( 'afg_colorbox_css' );

    But I dont know, only looked up what he calls files. Never tried plugin.

    Commented out unload of CSS for Colorbox. Should they now be the same? Then no reason to load 2.

    A good question is why old Colorbox work right now as you load incompatible jQuery 1.9.1. Dont know but I guess 1.8.3 comes out on top or it act as a sort of migrate thingy. Is a mess though, you should go with one or the other, not both. And if 1.9.1 then also include migrate.js Certain features are removed from 1.9.1 so migration tool needed. Some/many WordPress devs. have ignored "deprecated" status for too long :) But not just WordPress problem, why they beg people to use that file.


    Judging by many of the questions and bug reports we’ve gotten, far too many of you are trying to do an upgrade to jQuery 1.9 without also using jQuery Migrate. Stop hitting yourself! We created this plugin to make things easy on you. Just include the plugin after your jQuery file to see if it gives you any warnings. The updated jQuery Migrate plugin is available on jQuery’s CDN, and should be available on the Google and Microsoft CDNs within a few days:


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Lightbox Plus Colorbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic