Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The usage of "Drupal.url()" to load the script if needed does not respect pathPrefixes.
So if I'm on https://www.examle.com/en/a-page, using Drupal.url( 'libraries/lazysizes/lazysizes.min.js' ) would result in " https://www.examle.com/en/libraries/lazysizes/lazysizes.min.js". This should only use the basePath component of the URL, not the prefix.
Comment | File | Size | Author |
---|---|---|---|
#2 | use-basePath-3086717.patch | 678 bytes | DrColossos |
Comments
Comment #2
DrColossos CreditAttribution: DrColossos at CYLEDGE commentedComment #3
osmanGood catch @DrColossos, and thanks for the patch.
However, I don't thinkdrupalSettings.path.baseUrl
alone would be enough.On my multi-lingual site, I would need to use asdrupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + libraries/lazysizes/lazysizes.min.js'
to get the correct path.I'll play around with this a bit. but of course you're welcome to share your findings and patches.
Cheers,
osman
Comment #5
osmanComment #6
osman