Skip to content

AttributeCode column name length validation throws wrong error message #20766

Closed
@brosenberger

Description

@brosenberger

Preconditions (*)

  1. Magento Community 2.3.0

Steps to reproduce (*)

  1. go to Backend, Login with admin user
  2. go to Stores -> Attributes -> Product
  3. add new attribute (any values), set attribute code to custom_attribute_which_has_a_to_long_code_but_less_than_255
  4. click save attribute

Expected result (*)

  1. product attribute saved
  2. alternatively correct error message, that only 30 characters are allowed

Actual result (*)

  1. product attribute is not saved
  2. error message 'Attribute code "custom_attribute_which_has_a_to_long_code_but_less_than_255" is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.' is shown

Additional Information:

actual limit within the database for attribute code is varchar(255) which contradicts attribute code validation within https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php#L200 where only 30 characters are allowed as maximum

Metadata

Metadata

Labels

Component: CatalogEvent: mm19inFixed 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 developmentProgress: PR CreatedIndicates that Pull Request has been created to fix issueReproduced 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