Skip to content

Commit ec91a73

Browse files
committed
MAGETWO-98202: Additional Permissions for Design settings
1 parent e39bfb4 commit ec91a73

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,13 @@ public function beforeSave()
947947
&& !$this->authorization->isAllowed('Magento_Catalog::edit_category_design')
948948
) {
949949
foreach ($this->_designAttributes as $attributeCode) {
950-
$this->setData($attributeCode, $this->getOrigData($attributeCode));
951-
$this->setCustomAttribute($attributeCode, $this->getOrigData($attributeCode));
950+
$this->setData($attributeCode, $value = $this->getOrigData($attributeCode));
951+
if (!empty($this->_data[self::CUSTOM_ATTRIBUTES])
952+
&& array_key_exists($attributeCode, $this->_data[self::CUSTOM_ATTRIBUTES])
953+
) {
954+
//In case custom attribute were used to update the entity.
955+
$this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]->setValue($value);
956+
}
952957
}
953958
}
954959

0 commit comments

Comments
 (0)