I installed the jQuery Update module (7.x-3.x-dev)
When I enabled the jQuery Migrate Plugin, I got a lot of jQuery error.
"Uncaught ReferenceError: jQuery is not defined"
jQuery will not load for some reason.

There is a problem with other themes, bootstrap seems to be causing it.

Comments

klezer’s picture

Issue summary: View changes
markhalliwell’s picture

Status: Active » Closed (outdated)
jcisio’s picture

Status: Closed (outdated) » Active

Not outdated. This bug is still present with the latest version of the theme.

Uncaught ReferenceError: jQuery is not defined
    at ajax.js?osvazr:83

That file is bootstrap/misc/ajax.js when we move all scripts from header scope to footer. I can't see how this file is added, so it is not moved.

jcisio’s picture

Now I got that. bootstrap_js_alter() add the scripts using the default region with drupal_js_defaults() which is not configurable. So our hook_js_alter() to move scripts to footer can't be in a module, it must be in a Bootstrap subtheme.

While there is a workaround, I ask myself why we don't simply clone the old script (with region, weight etc.) but use drupal_js_defaults()?

markhalliwell’s picture

Status: Active » Closed (works as designed)

Ok, it may not be "outdated", but it's definitely "works as designed".

The weight of how scripts are loaded is important. There is also a very big difference between modules and themes; how and when they are loaded.

This project is a base theme, which means that it's alterations are ran after any modules do. So yes, any further alterations would have to be made in a sub-theme.

A project like https://www.drupal.org/project/advagg can help with a lot of this. Although not necessarily intuitive (especially if you don't understand how JS works), it is very powerful.

I'm closing this because I know for a fact this works just fine as I have implemented several sub-themes where the scripts were moved to the footer.