Skip to content

Commit 8e91f79

Browse files
author
Oleksandr Gorkun
committed
MC-16089: Category saved through API with parent category, saved like root category
1 parent 8fba0f8 commit 8e91f79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/Catalog/Model/Category.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,8 @@ public function beforeSave()
950950
) {
951951
foreach ($this->_designAttributes as $attributeCode) {
952952
$this->setData($attributeCode, $value = $this->getOrigData($attributeCode));
953-
if (array_key_exists($attributeCode, $this->_data[self::CUSTOM_ATTRIBUTES])) {
953+
if (!empty($this->_data[self::CUSTOM_ATTRIBUTES])
954+
&& array_key_exists($attributeCode, $this->_data[self::CUSTOM_ATTRIBUTES])) {
954955
//In case custom attribute were used to update the entity.
955956
$this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]->setValue($value);
956957
}

0 commit comments

Comments
 (0)