- Issue created by @duckydan
- Assigned to Rajan Kumar@2026
- Issue was unassigned.
- 🇫🇷France mably
Looks like "/" are allowed only once in library names:
foreach ($libraries_to_check as $library) { if (substr_count($library, '/') !== 1) { throw new BadRequestHttpException('The libraries to include are encoded incorrectly.'); } }
And here is what I have this for $library in my case:
asset_injector/css/fix_padding_top_exposition_slider
- Merge request !16Issue #3444733 by mably: Drupal 10.2.6 doesn't allow slashes in library names → (Merged) created by mably
- last update
7 months ago 8 pass - Status changed to RTBC
7 months ago 12:05pm 2 May 2024 - 🇺🇸United States justcaldwell Austin, Texas
That fixed it for us, too. Thanks @mably! 🙏
- 🇺🇸United States justcaldwell Austin, Texas
Tweaked the title and summary a bit to add some context.
- 🇺🇸United States justcaldwell Austin, Texas
For reference, the changes that triggered this issue appear to have occurred in 🐛 Warning: Undefined array key 1 in Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies() after update to Drupal 10.2.2 and when views ajax is enable. Active
- 🇩🇪Germany Anybody Porta Westfalica
Just ran into this after updating Drupal to 10.2.6.
I'm going to ping the maintainer as this is indeed critical and hard to find!
Furthermore we should open an issue in core for these things:
- Find out if the if clause is correct, makes sense and really needed:
if (substr_count($library, '/') !== 1) {
- Add information about the failing library to the exception, otherwise the error is absolutely useless for site owners to find out what went wrong
- I think the error message is misleading. I wouldn't think of an "incorrect encoding" if there's an unexpected "/" in the library name??
- Find out if the if clause is correct, makes sense and really needed:
- 🇩🇪Germany geek-merlin Freiburg, Germany
Yes, this makes sense.
Adding attributions. -
geek-merlin →
committed 8cb76d42 on 8.x-2.x authored by
mably →
Issue #3444733 by mably, duckydan, Anybody, justcaldwell, geek-merlin,...
-
geek-merlin →
committed 8cb76d42 on 8.x-2.x authored by
mably →
- Status changed to Fixed
7 months ago 9:15am 3 May 2024 - 🇩🇪Germany geek-merlin Freiburg, Germany
And released, and off:
https://www.drupal.org/project/asset_injector/releases/8.x-2.20 → - 🇩🇪Germany Anybody Porta Westfalica
Thank you very very much for your super quick reaction @geek-merlin! 🎉🚀
- 🇩🇪Germany Anybody Porta Westfalica
Here's the follow-up in core: 🐛 Improve "The libraries to include are encoded incorrectly" check and message Active
I confirmed this fixes the issue for Drupal core 10.2.x (10.2.6), patch applied on asset_injector v2.17.0 (no update for this module, so using patch instead)
- 🇺🇸United States duckydan
@edmoreta I think the most recent release (2.20) has this fix. I may be misunderstanding.
I haven't updated the asset_injector version, I need to stick to v2.17.0. I'm using a patch for that reason
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇨🇦Canada TrevorBradley
Note: This error was so bad on 2.19 (Complete CSS collapse) as we updated to 10.2.6, and the fix with 2.20 so complete, it's my opinion only but I'd strongly recommend flagging 2.19 as no longer supported.
We didn't catch in in our local and our dev environments because JS aggregation was only enabled on prod.