Skip to content

Required custom atttribute for Addresses fail to pass validation in checkout #39864

Closed
@andirosu

Description

@andirosu

Preconditions and environment

In a freshly updated 2.4.8. instance, I tried to order as guest. I have some required attributes for the Billing Address, created via a 3rd party module. They fail validation because of the call to \Magento\Quote\Model\CustomerManagement::validateAddresses , where someone hardcoded what attributes should the address have prior testing for validation.
This is the commit which introduced this: e565531

Steps to reproduce

  1. Create a required attribute for billing address.
  2. from the frontend, add items and try to checkout.
  3. complete all required inputs, including the newly-created one.
  4. try to submit your order.

Expected result

Order is placed successfully.

Actual result

Order isn't placed, error "$attribute is required" is thrown by the validator, where $attribute is the label of the newly created attribute in step #1.

Additional information

Let's call the newly-created custom attribute house_number.
When the billing address is saved to the quote, the house_number is saved as expected.
However, when creating and assigning the data to the new customer address in CustomerManagement.php#L164-L172, house_number isn't being transferred, thus triggering the validation error.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.8Indicates original Magento version for the Issue report.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions