Calculate redirects as relative paths when site is configured to use relative links. #335
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.
What’s changed
v3.2.0 contained changes to support support sites which were configured to generated relative links. At the time I implemented these changes we were not making use of the
old_paths
page redirection functionality. We have since started using this which caused me to realise that the redirect page generation did not work correctly when a site is configured to use relative links.This manifested in the redirect pages being create in the wrong location in the site hierarchy and their redirect URLs being wrong (pointing to paths which don't exist).
This PR updates the redirect functionality such that it now works correctly when sites are configured to use relative links . I have written some simple redirect unit tests as non existed previously.
Hope this all makes sense. Would be great if someone could give it some 👀 and consider it for inclusion. Very happy to discuss and fettle if required.
Cheers!
Identifying a user need
No UR done. User testing was what actually alerted us to this issue in the first place though, as users were not able to access redirect pages, because they were being generated incorrectly.
User story: