Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
klezer CreditAttribution: klezer commentedComment #2
markhalliwellComment #3
jcisio CreditAttribution: jcisio at Axess Open Web Services commentedNot outdated. This bug is still present with the latest version of the theme.
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.Comment #4
jcisio CreditAttribution: jcisio at Axess Open Web Services commentedNow 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()?
Comment #5
markhalliwellOk, 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.