Skip to content

Test PR: Prevent non-WC_Orders on the order received page#1

Open
boblinthorst wants to merge 3 commits into
trunkfrom
BL/prevent-non-orders-on-order-received-page
Open

Test PR: Prevent non-WC_Orders on the order received page#1
boblinthorst wants to merge 3 commits into
trunkfrom
BL/prevent-non-orders-on-order-received-page

Conversation

@boblinthorst

@boblinthorst boblinthorst commented Aug 17, 2023

Copy link
Copy Markdown
Owner

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:

Checkout_-_bobLocalTestSite

Checkout_-_bobLocalTestSite-3

WordPress_›_Error

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

  • Automatically create a changelog entry from the details below.
Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants