Basically a duplicate of an old issue that is either still an issue in 4.x or has shown up again:
https://www.drupal.org/project/lazy/issues/3282633

Similarly, we have a large number of sites running in subfolders
/site-a/homepage
/site-b/homepage
/site-x/homepage

Ideally, we would not have to configure each site with it's own unique path as the installation is the same for all. Currently the library path on all sites removes the subfolder path and becomes:
/libraries/lazysizes

But should be:
/site-a/libraries/lazysizes
/site-b/libraries/lazysizes
/site-x/libraries/lazysizes

Not sure if the patch applied in the previous issue would still roll on 4.x so made the attached (very new to patching). Any reason something like this couldn't be merged into the main project?

Issue fork lazy-3463866

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

dreg created an issue. See original summary.

norman.lol’s picture

Title: Library path wrong for subsites (4.x) » Library path wrong for subsites
Version: 4.0.0 » 4.0.x-dev
norman.lol’s picture

Status: Active » Needs work
StatusFileSize
new147.08 KB

There's a config in the module to override this path already. The current patch unfortunately doesn't work if an absolute URL has been entered. And it also won't work if the base path has been manually prefixed already.

I think we need to additionally check two things first:

  1. Is it an absolute URL
  2. Is it a relative URL and has the base path already been prefixed

In both cases the base path should not be added.

norman.lol’s picture

Title: Library path wrong for subsites » Fix library path if site inside subdirectory
Status: Needs work » Needs review
StatusFileSize
new898 bytes
norman.lol’s picture

StatusFileSize
new892 bytes
new311 bytes
norman.lol’s picture

The failing pipeline is unrelated to this issue and has already been addressed in #3471876: LazyForm too few arguments.

liam morland made their first commit to this issue’s fork.