-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add/source param to get subscriptions call #35051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/source param to get subscriptions call #35051
Conversation
plugins/woocommerce/includes/admin/helper/class-wc-helper-api.php
Outdated
Show resolved
Hide resolved
andfinally
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! 👌 Just left some minor thoughts.
jorgeatorres
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
|
I'm just having a go at testing this, but I'm having trouble checking it out into my local WooCommerce root. I'm getting |
|
@andfinally could it be because I created the PR via a fork of the repo? |
|
@andfinally here's a patch of the changes (minus the changelog update). |
|
@jorgeatorres thanks for the review. Am I right in thinking we can expect this to land in 7.2, given 7.1 is already in code freeze? (If it can still make it into 7.1, then great, but it's not an urgent change.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for the help with testing. Confirmed that source=my_subscriptions is added to the URL in the extensions tab request, and that other requests still work as expected.
(The active/inactive switch on the My Subscriptions tab isn't working on my customer test site, but it never has, so I don't think it's related. On wp-env, the switch isn't shown, perhaps because the site URL is http.)
|
@jorgeatorres it appears my last changes based on @andfinally 's feedback invalidated you original review. Can you please check and approve this again? There are also two failing CI checks. I looked through them - I'm not sure what needs to be done for the first, and the second doesn't seem related to any of the changes I made. Can you please take a look as well? Thanks! |
- Adds an optional $source argument to the WC_Helper_API::url() method - Get URL of page making WC_Helper::get-subscripitonts() request and add a source arg to the WC_Helper_API::get() request made by that method - Pass that source arg to the WC_Helper_API::url() methd from WC_Helper_API::get()
- Update "source" argument name across methods to "query_string" to be more generic - Use separate variables to make it clear the URI of the requesting page, and the value passed as the source query string are different
2aa2493 to
e1d0ca2
Compare
e1d0ca2 to
96d6407
Compare
jorgeatorres
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
All Submissions:
Changes proposed in this Pull Request:
We want to add a source parameter to WooCommerce.com API requests to the subscriptions endpoint
Related issue on WooCommerce.com: 13928-gh-Automattic/woocommerce.com
How to test the changes in this Pull Request:
Test My subscriptions
Other information:
pnpm --filter=<project> run changelog add?FOR PR REVIEWER ONLY: