For subsites, the path to the library doesn't take into account the base path.

eg.:

My site is located at http://myhost.com/mysubsite/web

The library path in the UI is '/libraries/lazysizes'

So the library should be located at http://myhost.com/mysubsite/web/libraries/lazysizes/lazysizes.min.js

Instead, I get a message that http://myhost.com/libraries/lazysizes/lazysizes.min.js is not found.

I could of course set the path manually, but then the path to the library would be different on local vs live versions of the same site. That would be bad practice.

Solution: include the base path in the settings

Issue fork lazy-3282633

Command icon 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

GlarDup created an issue. See original summary.

roger.bertran’s picture

StatusFileSize
new542 bytes

I've created a patch to fix it, it works for me.

norman.lol’s picture

Version: 8.x-3.11 » 8.x-3.x-dev

norman.lol’s picture

Status: Active » Needs review
StatusFileSize
new892 bytes

The current patch from #2 did not account for manually entered URLs in config.

We must cover both absolute library URLs and relative URLs with base path prefixed manually already.

Applied same changes as in #3463866: Fix library path if site inside subdirectory.