Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Regarding Chrome's Image-Breaking Timeout Bug


Go to End


15 Posts   6922 Views

Avatar
Shauna G

Community Member, 52 Posts

4 March 2010 at 6:59am

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.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

4 March 2010 at 7:23am

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.

Avatar
Shauna G

Community Member, 52 Posts

4 March 2010 at 8:04am

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".)

Avatar
UncleCheese

Forum Moderator, 4102 Posts

4 March 2010 at 8:39am

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

Avatar
Shauna G

Community Member, 52 Posts

4 March 2010 at 8:51am

Avatar
UncleCheese

Forum Moderator, 4102 Posts

4 March 2010 at 9:23am

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"

Avatar
Shauna G

Community Member, 52 Posts

4 March 2010 at 10:03am

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?

Go to Top