fix(group-subscription): update params; avoid secondary My Account redirect#151
Open
dkoo wants to merge 11 commits into
Open
fix(group-subscription): update params; avoid secondary My Account redirect#151dkoo wants to merge 11 commits into
dkoo wants to merge 11 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a collision between the short s invite-link query arg and WordPress core's reserved s (search) parameter, which prevented group-subscription invite links from completing. Also routes My Account error redirects straight to the edit-account endpoint so an existing secondary redirect doesn't strip the result params before the snackbar can render. Tests are updated to match the new param names.
Changes:
- Rename invite-link query args:
s→subscription,m→manager,k→keyin URL builder and request handler. - Replace base My Account permalink with
wc_get_account_endpoint_url( 'edit-account' )in bothprocess_invite_requestandprocess_link_invite_requestto avoid the secondary redirect that strips query args. - Update unit tests, plus version/changelog and a
newspack-scriptsdependency change.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/newspack-plugin/includes/plugins/woocommerce-subscriptions/group-subscription/class-group-subscription-invite.php | Renames invite query params and switches My Account redirect target to the edit-account endpoint. |
| plugins/newspack-plugin/tests/unit-tests/content-gate/group-subscriptions.php | Updates $_GET keys and URL-format assertions to use the new subscription/manager/key params. |
| plugins/newspack-plugin/newspack.php | Bumps plugin header version to 6.41.4-hotfix-group-subscription-invite-link-params.1. |
| plugins/newspack-plugin/package.json | Bumps version and changes newspack-scripts from workspace:* to 5.9.8 (deviates from other plugins). |
| plugins/newspack-plugin/CHANGELOG.md | Manually adds a hotfix changelog entry that is normally generated by CI. |
… [skip ci] ## newspack [6.41.4-hotfix-group-subscription-invite-link-params.1](https://github.com/Automattic/newspack-workspace/compare/newspack@6.41.3...newspack@6.41.4-hotfix-group-subscription-invite-link-params.1) (2026-05-28) ### Bug Fixes * **group-subscription:** update param names, avoid secondary My Account redirect ([16bf647](16bf647))
… [skip ci] ## newspack [6.41.4-hotfix-group-subscription-invite-link-params.2](https://github.com/Automattic/newspack-workspace/compare/newspack@6.41.4-hotfix-group-subscription-invite-link-params.1...newspack@6.41.4-hotfix-group-subscription-invite-link-params.2) (2026-05-28) ### Bug Fixes * revert unwanted chagnes ([24fcc41](24fcc41))
7894b87 to
54be7db
Compare
…params.2 [skip ci]" This reverts commit 54be7db.
… [skip ci] ## newspack [6.41.4-hotfix-group-subscription-invite-link-params.1](https://github.com/Automattic/newspack-workspace/compare/newspack@6.41.3...newspack@6.41.4-hotfix-group-subscription-invite-link-params.1) (2026-06-01) ### Bug Fixes * **group-subscription:** update param names, avoid secondary My Account redirect ([52ebcd6](52ebcd6)) * revert unwanted chagnes ([6579a25](6579a25))
# Conflicts: # plugins/newspack-plugin/CHANGELOG.md # plugins/newspack-plugin/newspack.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All Submissions:
Changes proposed in this Pull Request:
This fixes an issue with the implementation of group subscription invite URLs. The short
s(for subscription ID) param collides with WordPress core's reserved search param, which prevents group subscription invite links from fully processing. The fix: rename the required params so they're less likely to collide with params used for other purposes:sbecomessubscriptionmbecomesmanagerkbecomeskeyAlso fixes a second issue where redirecting to the base My Account URL to display an error message results in a secondary redirect to the
edit-accountsub-page, which strips params and prevents the user-facing snackbar message from appearing. The fix: always redirect straight to theedit-accountpage so the params aren't stripped in the secondary redirect.How to test the changes in this Pull Request:
NEWSPACK_CONTENT_GATESenabled, create a group subscription and assign to a reader who will be the manager.Please log in or register an account to join the group.You have successfully joined the group!This link is no longer valid. Please contact the group manager.This link is no longer valid. Please contact the group manager.Other information: