Problem/Motivation
Hello, there is a bug that loads the same file twice. To be able to test simply disable Add JavaScript Files
The test was carried out with:
- Drupal 10.2.3
- PHP 8.1
- MySQL 5.44
- Server Nginx
The path where the file is repeated are these:
https://example.com/core/assets/vendor/jquery.ui/ui/widget-min.js?v=10.2.3
https://example.com/modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui...
| Comment | File | Size | Author |
|---|
Issue fork jquery_ui-3420890
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
recrit commentedI am having this same issue with multiple duplicate JS and CSS files loaded on the page.
This issue may be a duplicate of #3371462: Module defines jQuery UI files independently from Core. Can cause CSS priority issues in AJAX calls, 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 #3371462: Module defines jQuery UI files independently from Core. Can cause CSS priority issues in AJAX calls.
For example, I am seeing the following duplicate JS files:
For example, I am seeing the following duplicate CSS files:
Comment #4
recrit commentedI 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.
Comment #5
recrit commentedupdated static patch with latest changes.
Comment #6
recrit commentedupdated static patch with latest changes.
Comment #7
recrit commentedupdated static patch with latest changes.
Comment #8
recrit commentedupdated the static patch with latest changes.
Comment #9
recrit commentedComment #10
recrit commentedMoved to needs work since there is an issue with the latest patch when using core's asset aggregation.
Comment #11
recrit commentedupdated 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.
Comment #12
nelo_drup commented#11 @recrit When I use the last interdiff, although the error is solved, other modules such as faq field start giving errors
Comment #13
recrit commented@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?
Comment #14
nelo_drup commented#13 @recrit When I use the patch the jquery accordion stops working my drupal version is 10.4.3
Comment #15
recrit commented@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 with
jquery_ui_accordion/accordion.I would suggest doing some debugging:
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);"Comment #16
recrit commentedComment #18
recrit commentedFor Drupal 10.4.x+ support along with jQuery UI updated to 1.14.1 in the jquery_ui module, test the MR 20 on #3483054: Update to jQuery UI 1.14.1, see comment #15 for details. The MR 20 #3483054: Update to jQuery UI 1.14.1 includes the changes from #3483054: Update to jQuery UI 1.14.1 and this issue #3420890: Remove duplicate jQuery UI JavaScript and CSS files .