Change storefrontRedirect
to ignore query parameters
#1900
Merged
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 is this pull request doing?
Change
storefrontRedirect
to ignore query parameters when matching redirects. For example, a redirect in the admin from/snowboards
to/collections/snowboards
will now match on the URL/snowboards?utm_campaign=buffer
and redirect the user to/collections/snowboards?utm_campaign=buffer
. This is a breaking change. If you want to retain the legacy functionality that is query parameter sensitive, passmatchQueryParams
tostorefrontRedirect()
:Without this change, redirects are default broken with any marketing query parameters. For example in Instagram: #1877 (reply in thread)
HOW to test your changes?
/collections/hydrogen
and make sure that it redirects to/collections/backcountry
/collections/hydrogen?someQueryParam=true
and make sure that it redirects to/collections/backcountry?someQueryParam=true
/collections/hydrogenWithExtraQueryParam
and make sure that it redirects to/collections/backcountry?test=true&someQueryParam=true
Post-merge steps
Checklist