FIX Correct trailing slash for subsite in another domain #590
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/silverstripe/silverstripe-subsites/actions/runs/10278313787/job/28441800184 which consists of failures like the below:
As of silverstripe/framework 5.2.20,
Controller::normaliseTrailingSlash()
won't normalise trailing slash for absolute URLs where the domain doesn't match the current site domain.This means if getting a link to a page on Subsite A from Subsite B, if the domains don't match, the trailing slash won't be normalised.
It's possible that it would be better to implement the
updateIsSiteUrl()
extension hook in an extension forDirector
and saying "yes that's a site URL" if it belongs to a domain of any subsite. I didn't attempt that because I don't know what sort of flow-on effects that might have. I'm especially hesitant to do that in a patch release.Note that the same problem happened on Fluent, see tractorcow-farm/silverstripe-fluent#872
Most likely we'll want to implement the
updateIsSiteUrl()
extension hook for both modules in a minor release, but I want at least one other opinion before I do that. Either way, IMO this PR should be merged for a patch fix.Issue