Skip to content

Commit a1a494d

Browse files
MC-33732: [Magento Cloud] - Create / update category using API returns : The "string" value's type is invalid. The "string[]" type was expected
1 parent 8c8912c commit a1a494d

File tree

1 file changed

+1
-2
lines changed
  • app/code/Magento/Catalog/Model/Category/Attribute/Backend

1 file changed

+1
-2
lines changed

app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ public function beforeSave($object)
104104
}
105105
if ($attributeCode == 'default_sort_by') {
106106
$data = $object->getData($attributeCode);
107-
$attributeValue = is_array($data) ? reset($data) :
108-
(!empty($data)) ? $data : null;
107+
$attributeValue = (is_array($data) ? reset($data) : (!empty($data))) ? $data : null;
109108
$object->setData($attributeCode, $attributeValue);
110109
}
111110
if (!$object->hasData($attributeCode)) {

0 commit comments

Comments
 (0)