-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Validate that the PO Number is set on the payment instance. #14393
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
Validate that the PO Number is set on the payment instance. #14393
Conversation
parent::validate(); | ||
|
||
if (empty($this->getInfoInstance()->getPoNumber())) { | ||
throw new LocalizedException(__('Purchase order number is a required field.')); |
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.
Can you add this string to the .csv so it can be translated?
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.
Done.
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.
Thanks @miguelbalparda ! I totally forgot about this 🤦♂️
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.
All good here.
parent::validate(); | ||
|
||
if (empty($this->getInfoInstance()->getPoNumber())) { | ||
throw new LocalizedException(__('Purchase order number is a required field.')); |
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.
All good here.
Hi @miguelbalparda, thank you for the review. |
Hi @centerax. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
This is a bad "fix". When did Magento decide that PO# is always required on the payment instance? That should be set by configuration, not hard-coded. |
I'm not that sure @dnadle, care to expand your comment? If you really think this shouldn't be in the core feel free to submit your patch with an explanation and assign it to me for review. |
The validation is performed only on the payment method Purchaseorder. I dont see how its a global validation for all payment methods as you seem to imply. |
OK, I take it back. We had a payment mode in production where the purchase order payment method was used with optional PO #, that was working through 2.2.6. An upgrade to 2.2.9 with this check surprised us. Sorry for the confusion. |
Np thanks for keeping this civilized. |
Description
Validate that the
po_number
is set on the info instance.Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist