Skip to content

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

Merged

Conversation

centerax
Copy link
Contributor

@centerax centerax commented Mar 27, 2018

Description

Validate that the po_number is set on the info instance.

Fixed Issues (if relevant)

  1. Optional PO number #6585

Manual testing scenarios

  1. Available on the issue description.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Mar 27, 2018

CLA assistant check
All committers have signed the CLA.

parent::validate();

if (empty($this->getInfoInstance()->getPoNumber())) {
throw new LocalizedException(__('Purchase order number is a required field.'));
Copy link
Member

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor Author

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 🤦‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good here.

@miguelbalparda miguelbalparda self-assigned this Jul 10, 2018
parent::validate();

if (empty($this->getInfoInstance()->getPoNumber())) {
throw new LocalizedException(__('Purchase order number is a required field.'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good here.

@magento-engcom-team
Copy link
Contributor

Hi @miguelbalparda, thank you for the review.
ENGCOM-2382 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@centerax thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team
Copy link
Contributor

Hi @centerax. Thank you for your contribution.
We will aim to release these changes as part of 2.2.7.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@dnadle
Copy link

dnadle commented Sep 23, 2019

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.

@miguelbalparda
Copy link
Contributor

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.

@centerax
Copy link
Contributor Author

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.

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.

@dnadle
Copy link

dnadle commented Sep 23, 2019

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.

@miguelbalparda
Copy link
Contributor

Np thanks for keeping this civilized.

@ngtuan96lc
Copy link

The bug still exists on Magneto version 2.4.1
Steps:

  • click Purchase Order
  • Fill valid info and fill Purchase Order Number
  • click button Purchase Order again
    image
    image

Root cause: purchase order number is not sent to server.
Everyone can fix follow: Mixin file Magento_SalesRule/js/action/select-payment-method-mixin.js

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants