Support Forum

Bootstrap error

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

Hi, I just change my wordpress theme and I’m seeing this error, any idea of what may be wrong? I’ll also ask the theme’s creator..

https://www.subnoise.es/foro/

Uncaught TypeError: Cannot read property ‘documentElement’ of null
at c.show (bootstrap.js?ver=1.0:6)
at c.enter (bootstrap.js?ver=1.0:6)
at HTMLDocument.d (jquery.js?ver=1.12.4:2)
at HTMLDocument.handle (jquery.js?ver=1.12.4:3)
at HTMLDocument.dispatch (jquery.js?ver=1.12.4:3)
at HTMLDocument.r.handle (jquery.js?ver=1.12.4:3)

31 Answers

New Answer

MP Mr Papa
Mr Papa
Member

the wp theme uses bootstrap.js which conflicts with the wp supplied jquery ui library…  unfortunate that theme authors continue to use stuff that conflict with base wp stuff…  of course, if a wp theme and other plugins dont use the wp jquery ui, you wouldnt notice it…

the key is to get jquery ui to load after bootstrap (which theme authors could easily ensure)…  since you are already loading both in the footer, probably going to have to modify the wp theme to control the loading order…

can you find in the wp theme where its loading bootstrap.js?

also should mention that you appear to be caching forum pages which is likely to cause other issues…  see this on pages:

<!-- Performance optimized by W3 Total Cache. Learn more: https://www.w3-edge.com/products/

Page Caching using disk: enhanced (SSL caching disabled)

 Served from: www.subnoise.es @ 2017-04-03 00:24:38 by W3 Total Cache -->

the forum page is dynamic so wp plugins that cache it will do it wrong and potentially cause issues…

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

That is weird, I have on the cache settings to never cache this:

wp-.*.php
index.php
foro
/foro
foro/*
/foro/

About the bootstrap, the theme uses a plugin called “bootstrap shortcodes”, could this be it?

YS Yellow Swordfish
Yellow Swordfish
Member

It is possible. Can it be deactivated so you can find out?

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

No, it wasn’t. I’m still waiting the answer from the theme autors 🙁

What about the cache? Which is the right way to tell the cache plugin not to cache the forum page?

YS Yellow Swordfish
Yellow Swordfish
Member

As far as I am aware the /foro entry should do it. @mr-papa will correct me if I am wrong. have you added this exclusion to all cache types? And, if so, perhaps you may need to talk to the cache authors support.

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

Turns out the message doesn’t mean the page has been cached, only that caching is available

YS Yellow Swordfish
Yellow Swordfish
Member

For the record – do you have your forum set to load javascript in the footer (Integration – Page and Permalink).

If not – give it a try…

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

Yes, I have “Filter WP list pages” and “Load javascript in footer” checked

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

Found this in my functions.php

wp_enqueue_script(‘bootstap’, get_template_directory_uri().’/assets/js/bootstrap.js’, ‘jquery’, ‘1.0’, TRUE);

 

“Bootstrap” is mispelled, could this be the reason of the error?

YS Yellow Swordfish
Yellow Swordfish
Member

Probably worth telling the authors that. It is not a problem but is inelegant.

Try – for the sake of testing – changing that word TRUE at the the end to FALSE…

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

I’ve tried to change a few things in the child’s theme functions.php but it always crashes the site (php is not my thing). I’ll keep looking on how to do it

YS Yellow Swordfish
Yellow Swordfish
Member

So what happened when you changed that to FALSE?
And – by the way – you should probably clear your browser cache after changes and before a test

JV Joan Alamo Vallejo
Joan Alamo Vallejo
Member

I mean I can’t get the functions.php to work 🙁

Something like this should work, isn’t it?

<?php

function wf_register_scripts() {

…. code in here…
}

?>

YS Yellow Swordfish
Yellow Swordfish
Member

Yes – but I do not know, of course, what you are trying to do.

And – I would still like to know what happened upon changing the last parameter to false. That should have switched the load order…