File tree 1 file changed +7
-4
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,13 @@ public function execute()
128
128
);
129
129
130
130
if ($ attribute ->getId () && !$ attributeId || $ attributeCode === 'product_type ' || $ attributeCode === 'type_id ' ) {
131
- $ message = strlen ($ this ->getRequest ()->getParam ('attribute_code ' ))
132
- ? __ ('An attribute with this code already exists. ' )
133
- : __ ('An attribute with the same code (%1) already exists. ' , $ attributeCode );
134
-
131
+ if ($ attributeCode === 'product_type ' || $ attributeCode === 'type_id ' ) {
132
+ $ message = __ ('Code (%1) is a reserved key and cannot be used as attribute code. ' , $ attributeCode );
133
+ } else {
134
+ $ message = strlen ($ this ->getRequest ()->getParam ('attribute_code ' ))
135
+ ? __ ('An attribute with this code already exists. ' )
136
+ : __ ('An attribute with the same code (%1) already exists. ' , $ attributeCode );
137
+ }
135
138
$ this ->setMessageToResponse ($ response , [$ message ]);
136
139
137
140
$ response ->setError (true );
You can’t perform that action at this time.
0 commit comments