Test PR: Prevent non-WC_Orders on the order received page#1
Open
boblinthorst wants to merge 3 commits into
Open
Test PR: Prevent non-WC_Orders on the order received page#1boblinthorst wants to merge 3 commits into
boblinthorst wants to merge 3 commits into
Conversation
To ensure they have an implementation of the get_order_key function. Visits to the order_received page with the id of a refund result in a fatal error.
rolf-yoast
approved these changes
Aug 21, 2023
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.
Created this PR to share what I would share with the WC team. So that it can be reviewed on clarity and whether I'm missing something.
Should follow:
https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md
Hey there kind people 👋
We saw some fatal errors in our logs, that we could trace back to a WooCommerce function. I did not see an issue for what we found, so we decided to just create a community patch.
I did not see any unit tests, so did not contribute there. If they do exist, do let me know, and I'll see if I can add this particular case.
If you'd like for an issue to exist. Just point me to where to create it, and I'll act 🙂
Submission Review Guidelines:
Changes proposed in this Pull Request:
I'm unsure how, but we were seeing visits to the order-received page, with the post id of a refund. I'd expect this to result in an unspecific order-received page. but we got a fatal error instead. I investigated on a clean install, these are my findings:
We think it would be better if this case respons similarly to the non-order cases, so that's what this PR is intended to achieve.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Preconditions:
Have performed an order and a refund of that order.
Actions
Visit
$site/checkout/order-received/$order_id/, where $order_id is the post ID of the refund.Validation
Before this PR, this would result in a fatal error, ensure it now results in a generic order confirmation page.
Changelog entry
Details
Significance
Type
Message
Comment