Problem/Motivation
Underscore.js library was deprecated in Drupal 9.4 (https://www.drupal.org/node/3273118)
But it is used in following files: attributes.js, drupal.bootstrap.js, modal.js
This causes unpredictable JS errors under Drupal 10.
Proposed resolution
There is a quick fix for this issue: library still present in Drupal 10 core but was renamed to 'core/internal.underscore'.
I've added merge request to add this library as dependency for mentioned files and this solves a problem for Drupal 10.0.x.
This is safe for both Drupal 10 and Drupal 9.5 because it was deprecated in Drupal 9.4. So Drupal 9.5 (which is requirement since 3.27) has Underscore.js library defined as both 'core/underscore' and 'core/internal.underscore'.
P.S.: Created separate Issue #3343712 to discuss a long term solution.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | underscore-3343708-9.patch | 1.2 KB | chris matthews |
Issue fork bootstrap-3343708
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
f1mishutka commentedComment #4
f1mishutka commentedComment #5
f1mishutka commentedChanged priority to Major because this could be show stopper for projects under Drupal 10
Comment #6
f1mishutka commentedComment #7
f1mishutka commentedComment #8
chris matthews commentedManually tested the patch generated from the merge request and it provides a temporary fix for this issue so taking the liberty to mark as RTBC. @shelane @wundo, would you be able to commit merge request !23 and ideally tag a new 8.x-3.28 release?
Comment #9
chris matthews commentedHere is a patch that includes jquery dependency updates as well:
THIS
TO THIS
For reference: https://www.drupal.org/node/3067969
Comment #10
shelaneI will need to update dependencies in composer and do a hook to make sure those dependencies are enabled.
Comment #11
f1mishutka commentedAs I understand jQuery UI stays in Drupal 10 core. So there is no need to rely on jquery_ui module.
So there is no need for second patch with `core/jquery.ui` replaced to `jquery_ui/jquery_ui`
We are running bootstrap theme under Drupal 10 for two month already with just patch from merge request with no issues at all.
My proposal is to merge it as simple as it is in merge request. This is enough quick-fix for people can use it already under Drupal 10 without patches) and then concentrate efforts on issue #3343712 as a long-term solution for Drupal 10.1+
Comment #12
chris matthews commentedYeah, I do agree @f1mishutka. Good call.
Comment #15
shelaneComment #16
shelane