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
Fix PHP notice when outside of orders screens #38641
Conversation
Hi @coreymckrill, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: d21cd0b
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
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.
👍 Approving, but the extraneous files should be removed before merging. Thanks again for catching this notice @jorgeatorres
I also noticed from the PR screenshot that I forgot to update the version placeholder in the two wc_doing_it_wrong
calls (currently x.x.x
). Would it make sense to update those here? If not, I'll just open a separate PR.
Hey @coreymckrill! Thanks for the review. I did push some files by mistake, but those have been removed now. I've also updated the 'x.x.x' version numbers per your request. You'll have to review again, though, as the change dismissed the previous review. Thanks again! |
Submission Review Guidelines:
Changes proposed in this Pull Request:
After merging #38617 I noticed a PHP notice started appearing on all screens:
While #38617 made this evident, this is IMHO a failure in our orders page controller, since its logic is executed on every page even when not viewing an orders-related screen.
This PR addresses this by returning early if we're not on an admin page with
wc-orders
in its slug.How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
trunk
.