Skip to content

Commit f6a9459

Browse files
author
Bartosz Kubicki
committed
Fix for custom product attribute changing 'backend_type' when 'is_user_defined = 1' and get updated/saved in Admin Backend
Fix for custom product attribute changing 'backend_type' when 'is_user_defined = 1' and get updated/saved in Admin Backend Fix for custom product attribute changing 'backend_type' when 'is_user_defined = 1' and get updated/saved in Admin Backend
1 parent 1804146 commit f6a9459

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute

1 file changed

+4
-4
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ public function execute()
222222
$data['backend_model'] = $this->productHelper->getAttributeBackendModelByInputType(
223223
$data['frontend_input']
224224
);
225+
226+
if ($model->getIsUserDefined() === null) {
227+
$data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
228+
}
225229
}
226230

227231
$data += ['is_filterable' => 0, 'is_filterable_in_search' => 0];
228232

229-
if ($model->getIsUserDefined() === null || $model->getIsUserDefined() != 0) {
230-
$data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
231-
}
232-
233233
$defaultValueField = $model->getDefaultValueByInput($data['frontend_input']);
234234
if ($defaultValueField) {
235235
$data['default_value'] = $this->getRequest()->getParam($defaultValueField);

0 commit comments

Comments
 (0)