Skip to content

Commit

Permalink
ENGCOM-3158: Fix for custom product attribute changing 'backend_type'…
Browse files Browse the repository at this point in the history
… when 'is_user_defined = 1' and get updated/saved in Admin Backend #18196

 - Merge Pull Request #18196 from bartoszkubicki/magento2:attribute-backend-type-unexpected-change
 - Merged commits:
   1. f6a9459
  • Loading branch information
magento-engcom-team committed Oct 11, 2018
2 parents 74aa43b + f6a9459 commit 1a54c38
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ public function execute()
$data['backend_model'] = $this->productHelper->getAttributeBackendModelByInputType(
$data['frontend_input']
);

if ($model->getIsUserDefined() === null) {
$data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
}
}

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

if ($model->getIsUserDefined() === null || $model->getIsUserDefined() != 0) {
$data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']);
}

$defaultValueField = $model->getDefaultValueByInput($data['frontend_input']);
if ($defaultValueField) {
$data['default_value'] = $this->getRequest()->getParam($defaultValueField);
Expand Down

0 comments on commit 1a54c38

Please sign in to comment.