magento2: Product attributes product_type, type_id cannot be created/edited form admin
Preconditions (*)
- Magento 2.3.5-p1
Steps to reproduce (*)
- IF product attributes with following code does not exist
product_type
ortype_id
then attempt to create any of them - ELSE edit any of them and change anything
Expected result (*)
- Attribute is not saved. Error message is shown
- text: Code “product_type” is a reserved key and cannot be used as attribute code.
- text: Code “type_idis” a reserved key and cannot be used as attribute code.
Actual result (*)
- Either of following messages appear
An attribute with this code already exists.
ORAn attribute with the same code (product_type) already exists.
It’s due to following line of code https://github.com/magento/magento2/blob/39012d4ea79157cb12eef348cc3448d955c0ecc5/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php#L130 implemented in https://github.com/magento/magento2/commit/ca0da34ee2691bfaca1c74d94a0db33377d4e54c#diff-9ff38a88c1abf86286f77b64c8bc9b38 and https://github.com/magento/magento2/commit/b9d13e69c4928a0b6d740845bed305a399a42fd5#diff-9ff38a88c1abf86286f77b64c8bc9b38
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- 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”.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (12 by maintainers)
Hi @IgorM92. Thank you for your report. The issue has been fixed in magento/magento2#28663 by @AbdulRahmanAbouzaid in 2.4-develop branch Related commit(s):
The fix will be available with the upcoming 2.4.2 release.
Hello @IgorM92 @AbdulRahmanAbouzaid
Thank you for your report and collaboration!
This issue has been reviewed and discussed during the Triage Meeting with Magento Product Managers.
The results and resolution based on https://github.com/magento/magento2/issues/28479#issuecomment-640722555
product_type
andtype_id
are reserved keys in Magento that in use through a lot of functionality. So, allowing to save such names will required a lot of effort for development and testing and the final value does not worth itThe expected result should be updated: