Skip to content

Missed form validation in Admin Order Address Edit route sales/order/address #19360

Closed
@ilnytskyi

Description

@ilnytskyi

Preconditions (*)

Magento 2.2.*
EAV validation rules are not checked during editing an address in order.
route: sales/order/address
See column validate_rules in table customer_eav_attribute
e.g. name may have '{"max_text_length":255}'
Controller: \Magento\Sales\Controller\Adminhtml\Order\AddressSave::execute

This rules work in other forms on fronted and in address form and during creating new order from Admin
route: sales/order_create/index/

Steps to reproduce (*)

  1. Create an order
  2. Find the order in admin
  3. Click edit on address section
  4. Fill the field firstname or lastname with any characters till length be more than 255
  5. Save address and see saved value

Expected result (*)

  1. The errors should be shown e.g.
    Shipping Address: "First Name" length must be equal or less than 255 characters.
    Billing Address: "First Name" length must be equal or less than 255 characters.
  2. Address should not be saved as in sales/order_create/index
    selection_005

Actual result (*)

  1. Form saves and invalid data shown on the page
    selection_004
    UPD: so on the screenshot there is concatination with lastname.
    Max length in DB is 255 so it relates to max value.
    But if we set the rule to e.g. 100 symbols in customer_eav_attribute it's still possible to save 255 characters from this form

Metadata

Metadata

Assignees

Labels

Component: CustomerFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions