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.
By darkhorse314 on
Hello folks,
Currently, Drupal is using jQuery 3.2.1. But I need to downgrade it to 2.2.4. So I have followed the guidelines from here and from Drupal answers here. My bartik.info.yml
file currently looks like this:
libraries:
- bartik/global-styling
- bartik/global-scripts
libraries-override:
core/jquery: bartik/jquery-custom
and my bartik.libraries.yml
looks like this:
global-styling:
css:
theme:
css/main.css: {}
global-scripts:
js:
js/plugins.js: {}
js/drupal-main.js: {}
js/vendor/modernizr-3.3.1.min.js: {}
jquery-custom:
header: true
remote: https://github.com/jquery/jquery.js
version: "2.2.4"
license:
name: MIT
url: https://github.com/jquery/jquery/blob/2.2.4/LICENSE.txt
gpl-compatible: true
js:
js/jquery-2.2.4.min.js: { minified: true, weight: -20 }
dependencies:
- core/drupal
- core/jquery
- core/jquery.once
However, I keep getting Uncaught ReferenceError: jQuery is not defined.
I am not sure where the problem is at this point. Did anyone else face the same issue? If so, how did you solve this?