Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Regarding Chrome's Image-Breaking Timeout Bug

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 4552 Views
  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    The only JS "error" is the warning: "reference to undefined property jQuery.cache[id][name]" in one of the jQuery library files.

    Another look at the rendered code that Chrome sees, though, and I notice that only the opening anchor tag is created and filled. After that, it ends the list with neither the img tag nor the closing tag for the anchor. I assume this is a symptom, but it might give some insight.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    There's a file called imagegallery_init.js that shows all of the images on body load. I suspect that's what's failing. The purpose of the script is to prevent people from clicking an image before the lightbox handlers have been attached. I would investigate that script and see if it's executing correctly.

  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    Okay, this is interesting... I revisited the site using Chrome to see if I could see if that JS file was executing correctly, and this time, the code showed all of the images (and doesn't appear to be using my template), even though it only did one at a time earlier (I even tested with multiple images in the gallery). It generates the code for the entire list item, img tag and closing tags and all, when it does this.

    I hadn't changed anything since I posted last, but had to clear Chrome's cache and do a ?flush=all on the page for it to use the right template (both for my last response and for now). And, of course, it's now generating the list item correctly, though sans the "gallery-layout loaded" class assignments.

    So far, this has been an issue exclusive to Chrome. The imagegallery_init.js loads correctly in Firefox, but not in Chrome for some reason.

    I did notice that Firefox's Web Developer extension doesn't like your if statement in imagegallery_init.js. It kicks back the warning "test for equality (==) mistyped as assignment (=)?", but I tried "==" and Firefox would do the same as Chrome (never load the image, and sit with a spinning wheel and never assign the "loaded" class to the list). Given the behavior (not to mention the same use of "=" in an equality check in a jQuery file), I assume the "=" is correct? Why, then, does it kick back a warning? I'm still learning JavaScript (particularly more advanced stuff), as my stuff usually has things like loops and if statements in server-side code (and every other language I've used uses "==" for equality checks, so JS's behavior strikes me as odd).

    (On a side note, it appears that a line in your ImageGallery.css file is missing a semicolon. The color declaration in "#pagination-imagegallery a:link, #pagination-imagegallery a:visited".)

  • UncleCheese
    Avatar
    4085 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    The single = is correct, because that line is testing whether the assignment is true. Do you have a link to the project?

  • Shauna G
    Avatar
    Community Member
    52 Posts
  • UncleCheese
    Avatar
    4085 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    Well, the image gallery demo works in Chrome, but yours doesn't. Yours works in every other browser I try, though.

    It's gotta be a JS conflict of some sort. Try removing those two scripts, "menuGoto" and "selectItem"

  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    That did it. Though it's interesting that those scripts loaded, as they shouldn't have (at least, it wasn't my intent to have them load).

    Those scripts are part of a block of code that is set to only load if the URLSegment is one of a handful of specific segments (and the galleries aren't among that group of pages). Does the template JS call ignore template if, then?

    4552 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.