Closed mattallan closed 1 year ago
Changes look good to me. I tested the changes with the code snippets provided. I replicated the error and confirmed the fix.
I also ran the code snippets with an order and confirmed that the 2 params are passed etc.
Fixes #421
Description
Third-party developers that hook onto the
woocommerce_update_order
hook and try to use the second parameter are receiving fatal errors with WC Subscriptions installed.From the issue, the developers of Wholesale Pro Plugin have been getting the following fatal errors which is preventing renewals from processing:
To resolve these issues, this PR updates our
woocommerce_update_order
action hook which is called inside of our Subscription data store classes to match the same hooks in the latest WooCommerce Core version.There are no concerns with this breaking backwards compatibility as this is just adding a parameter to a hook. So all existing code using the previous version of this hook will operate normally:
How to test this PR
The
woocommerce_update_order
hook is called every time we call$subscription->save()
, therefore I used the following snippet of code to test these changes:trunk
in WP Console.You can also test this PR in a similar way to how the issue was reported to us:
functions.php
trunk
attempt to process a process renewal with Action Scheduler.Product impact