Skip to content

Commit ba04983

Browse files
Merge pull request #4210 from magento-qwerty/MC-16089
Fixed Issues: - MC-16089: Category saved through API with parent category, saved like root category
2 parents b651a26 + b9d8ffc commit ba04983

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,10 +948,10 @@ public function beforeSave()
948948
)
949949
&& !$this->authorization->isAllowed('Magento_Catalog::edit_category_design')
950950
) {
951-
$this->getCustomAttributes();
952951
foreach ($this->_designAttributes as $attributeCode) {
953952
$this->setData($attributeCode, $value = $this->getOrigData($attributeCode));
954-
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])) {
955955
//In case custom attribute were used to update the entity.
956956
$this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]->setValue($value);
957957
}

0 commit comments

Comments
 (0)