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.
Follow-up to #2642046: libraries-override does not update drupalSettings libraries array
Problem/Motivation
I haved added a global-styling
library in my theme. This library has two other dependencies.
global-styling:
version: VERSION
css:
core:
css/core/base.css: {}
css/core/base-drupal.css: {}
css/core/iehacks.min.css: { weight: 999, browsers: { IE: 'lte IE 7', '!IE': false }, minified: true }
dependencies:
- yaml/html5shiv.printshiv
- yaml/yaml.focusfix
Now if you load the source code and search for html5shiv.printshiv
you will not find this library in the drupalSettings libraries array.
This looks like a bug to me, but I don't know why this array exists in drupalSettings.
Proposed resolution
Add all libraries to the array and not just a few.
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
hass CreditAttribution: hass commentedComment #4
Wim LeersThis is by design. See #2368797: Optimize ajaxPageState to keep Drupal 8 sites fast on high-latency networks, prevent CSS/JS aggregation from taking down sites and use HTTP GET for AJAX requests.