Skip to content

Commit 40e128c

Browse files
Bartosz Kubickigelanivishal
Bartosz Kubicki
authored andcommitted
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 4f94998 commit 40e128c

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
@@ -230,14 +230,14 @@ public function execute()
230230
$data['backend_model'] = $this->productHelper->getAttributeBackendModelByInputType(
231231
$data['frontend_input']
232232
);
233+
234+
if ($model->getIsUserDefined() === null) {
235+
$data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
236+
}
233237
}
234238

235239
$data += ['is_filterable' => 0, 'is_filterable_in_search' => 0];
236240

237-
if ($model->getIsUserDefined() === null || $model->getIsUserDefined() != 0) {
238-
$data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
239-
}
240-
241241
$defaultValueField = $model->getDefaultValueByInput($data['frontend_input']);
242242
if ($defaultValueField) {
243243
$data['default_value'] = $this->getRequest()->getParam($defaultValueField);

0 commit comments

Comments
 (0)