Skip to content

Commit ee76114

Browse files
author
Stanislav Idolov
authored
ENGCOM-3202: [BUGFIX] [issue-10205] Always set the entity_type_id for updating pro… #18622
2 parents fdb86a5 + 3bbcb4a commit ee76114

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Repository.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr
106106
*/
107107
public function save(\Magento\Catalog\Api\Data\ProductAttributeInterface $attribute)
108108
{
109+
$attribute->setEntityTypeId(
110+
$this->eavConfig
111+
->getEntityType(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE)
112+
->getId()
113+
);
109114
if ($attribute->getAttributeId()) {
110115
$existingModel = $this->get($attribute->getAttributeCode());
111116

@@ -144,11 +149,6 @@ public function save(\Magento\Catalog\Api\Data\ProductAttributeInterface $attrib
144149
$attribute->setBackendModel(
145150
$this->productHelper->getAttributeBackendModelByInputType($attribute->getFrontendInput())
146151
);
147-
$attribute->setEntityTypeId(
148-
$this->eavConfig
149-
->getEntityType(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE)
150-
->getId()
151-
);
152152
$attribute->setIsUserDefined(1);
153153
}
154154
if (!empty($attribute->getData(AttributeInterface::OPTIONS))) {

0 commit comments

Comments
 (0)