-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fatal error when upgrading to a version with different constructor arguments #4438
Comments
Sounds like this paJDYF-43G-p2 is relevant. |
Thank you for pointing that out, @htdat. That link is relevant in a way that when a breaking change (like a new constructor parameter) is introduced we have to consider other parties who might depend on it because they might not be aware and the change will break their code. What surprised me with this issue is that WCPay itself will break on upgrade. The solution might be to avoid breaking changes, ie by making the new constructor argument optional, even though that is not ideal and a bit unclean. |
@haszari sending this one to your team since the problem is coming from Disputes. |
Thanks @vbelolapotkov – added to Helix's board for prioritisation. |
Not specific to disputes, same as #7464 |
Thanks @jessy-p.
Summarising this for clarity. Reminder – P2 links aren't readable and we need to get the relevant context on the issue.
Closing as a duplicate of #7464 If anyone has more info here, and there's something for Helix to action, please comment & reopen or log a new issue. |
Describe the bug
This bug is discovered when we are requiring new argument for WC_REST_Payments_Disputes_Controller.
When upgrading to a version that requires 2nd argument, it throws a fatal error as if the 2nd parameter isn't passed.
The fatal error is not too harmless. It's only showing and might alert merchants.
To Reproduce
WC_REST_Payments_Disputes_Controller
's constructor to accept a new argument and pass that argument from class-wc-payments.php.npm run build
on that modified code and install + activate the generatedwoocommerce-payments.zip
.Actual behavior
A fatal error of too few argument will be thrown.
Screenshots
Expected behavior
No fatal error.
Additional context
I laid out a more lengthy explanation here. tl;dr; looks like the older version of class-wc-payments.php is executing while
class-wc-rest-payments-disputes-controller.php
is updated with newer version within the same runtime.I think this reported problem is caused by this same problem due to this change.
The text was updated successfully, but these errors were encountered: