Roots Discourse

NextGen Gallery Fancybox Conflict

#1

I have the latest version of Wordpress running Sage 8.2.1 with NextGen Gallery 2.1.60 and NextGen Gallery Plus 1.3.31 installed. I’m using the Pro Masonry feature with Fancybox and it’s throwing several errors.

After switching to the default WP theme and the errors disappearing this issue is linked to the Sage theme. I also disabled all plugins & cleared cache.

The errors are:

jquery.fancybox-1.3.4.pack.js?ver=2.1.60:18
Uncaught TypeError: Cannot read property ‘msie’ of undefined(…)

captions.js?ver=4.5.3:3
Uncaught TypeError: Cannot read property ‘msie’ of undefined(…)

jquery.js:9793
Uncaught TypeError: t.indexOf is not a function(…)ht.fn.load

Any ideas how to fix this?

0 Likes

#2

None of those errors are directly related to Roots. Best thing to do is Google/Youtube search on how to debug JavaScript console errors; you could even search for those specific errors in each respective script.

0 Likes

#3

Hi @cfx, thanks for your reply.

If I use the default WP 2016 theme + NextGen plugins, the errors are gone but if I use the Sage theme, they exist. So doesn’t that point to the Sage theme as the issue?

0 Likes

#4

It might, depending on changes you’ve made to either theme or how the plugins are developed. Can you verify how many instances and which versions of jQuery are loaded?

0 Likes

#5

Sure thing, it’s loading in the head and just one instance:

<script type='text/javascript' src='http://localhost/asaderococina/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
<script type='text/javascript' src='http://localhost/asaderococina/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>

I also disabled Soil Relative Urls since it was conflicting with the NextGen plugin.

Thanks so much for your help with this!

0 Likes

#6

Seems those plugins are using an outdated jQuery method.

0 Likes

#7

Yep, I found that link before posting here. :slight_smile: The site is using the jquery migrate plugin and it’s still broke.

Even if it’s using the outdated jquery method, how is it that the feature works with the default WP theme?

0 Likes

#8

Probably because Soil enqueues a modern version of jquery, and Sage has that theme option set by default…

0 Likes