Closed (fixed)
Project:
Sites
Version:
1.x-dev
Component:
Sites path prefix
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 Jun 2026 at 13:21 UTC
Updated:
5 Jul 2026 at 12:50 UTC
Jump to comment: Most recent
A path /foo/foo-bar does not work correctly.
Create a sub site with prefix foo. Than add site content with alias foo-bar.
Cut prefix after a / or if the path ends.
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
Comment #3
harlor commentedComment #6
hydra commentedThanks @harlor — the fix looks right to me. I rebased onto current
1.xand added test coverage so it stays fixed.
For the record, the bug is the missing path-segment boundary:
str_starts_with('/subsite-bar', '/subsite')is
TRUE, so an alias like/subsite-baron the default site was beingmistaken for the
subsiteprefix and routed into the subsite. Your change fixesthat by only matching on an exact prefix or one followed by a
/.I added a data-provider unit test on
pathIsUsingPrefix()covering the exactprefix, prefix + sub-path, and the boundary cases (
/subsite-bar,/subsiteother→ not the prefix), plus arequestIsUsingPrefix()regression for the reported alias case. They fail on the old
str_starts_with()and pass with your fix.