- Issue created by @Nelo_Drup
- πΊπΈUnited States recrit
I am having this same issue with multiple duplicate JS and CSS files loaded on the page.
This issue may be a duplicate of π Module defines jQuery UI files independently from Core. Can cause CSS priority issues in AJAX calls Needs review , however that ticket focused on CSS and there is no changes in the open MR as of 2024-06-03.Duplicate JS and CSS files cause performance issues since it bloats the aggregated files and can cause other issues as noted in π Module defines jQuery UI files independently from Core. Can cause CSS priority issues in AJAX calls Needs review .
For example, I am seeing the following duplicate JS files:
modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js?v=1.13.2 core/assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js?v=10.2.6 core/assets/vendor/jquery.ui/ui/keycode-min.js?v=10.2.6 modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/keycode-min.js?v=1.13.2 core/assets/vendor/jquery.ui/ui/widgets/menu-min.js?v=10.2.6 modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/widgets/menu-min.js?v=1.13.2 modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/safe-active-element-min.js?v=1.13.2 core/assets/vendor/jquery.ui/ui/safe-active-element-min.js?v=10.2.6 modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/unique-id-min.js?v=1.13.2 core/assets/vendor/jquery.ui/ui/unique-id-min.js?v=10.2.6 modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/version-min.js?v=1.13.2 core/assets/vendor/jquery.ui/ui/version-min.js?v=10.2.6 modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/widget-min.js?v=1.13.2 core/assets/vendor/jquery.ui/ui/widget-min.js?v=10.2.6
For example, I am seeing the following duplicate CSS files:
modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/autocomplete.css core/assets/vendor/jquery.ui/themes /base/autocomplete.css modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/core.css core/assets/vendor/jquery.ui/themes/base/core.css modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/menu.css core/assets/vendor/jquery.ui/themes/base/menu.css modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/theme.css core/assets/vendor/jquery.ui/themes/base/theme.css
- Merge request !173420890 - Remove duplicate jQuery UI JavaScript and CSS files β (Open) created by recrit
- Status changed to Needs review
9 months ago 3:40pm 3 June 2024 - πΊπΈUnited States recrit
I created an MR with code in the library alter to replace the actual files in the core libraries.
I attached a static patch to be used for builds only. Please use the issue branch for any updates to the patch. - Status changed to Needs work
8 months ago 2:13pm 3 July 2024 - πΊπΈUnited States recrit
Moved to needs work since there is an issue with the latest patch when using core's asset aggregation.
- Status changed to Needs review
8 months ago 5:00pm 3 July 2024 - πΊπΈUnited States recrit
updated the static patch with latest changes to fix issue with JS/CSS aggregation. This sets library file weights to the same as core so that files can be replaced with the jquery_ui contrib module files.
#11 @recrit When I use the last interdiff, although the error is solved, other modules such as faq field β start giving errors
- πΊπΈUnited States recrit
@nelo_drup The faqfield module does have the correct dependency for
jquery_ui_accordion/accordion
. The change in this ticket should not affect that dependency.What are the errors that you are seeing?
What version of faqfield are you using?
#13 @recrit When I use the patch the jquery accordion stops working my drupal version is 10.4.3
- πΊπΈUnited States recrit
@nelo_drup This patch does not affect jQuery UI libraries, for example
jquery_ui_accordion/accordion
. It only replaces JavaScript files in the Drupal Core libraries with the equivalent files in the jQuery UI module's assets directory.
For that reason, it would not be causing the issues that you are seeing withjquery_ui_accordion/accordion
.I would suggest doing some debugging:
- Are there any JavaScript errors on the page in the developer console? Use the browser's developer tools to inspect the page.
- Check the Drupal watchdog logs for any errors
- Verify that "jquery_ui_accordion" is installed
- Do you have any custom code - JavaScript or Drupal - that could be interfering with it
- If you have access to Drush on the site, then post the output of the following commands in order to see the library definitions:
drush ev "echo print_r(\Drupal::service('library.discovery')->getLibraryByName('jquery_ui_accordion', 'accordion'), TRUE);"
drush ev "echo print_r(\Drupal::service('library.discovery')->getLibraryByName('faqfield', 'faqfield.accordion'), TRUE);"