Skip to content

Commit 3b2903e

Browse files
committed
ACP2E-3486: Default values are not set for date and time attributes with products RestAPI
1 parent 58ae313 commit 3b2903e

File tree

1 file changed

+4
-1
lines changed
  • app/code/Magento/Eav/Model/Entity/Attribute/Backend

1 file changed

+4
-1
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ public function beforeSave($object)
5757
}
5858

5959
$defaultValue = $this->getDefaultValue();
60-
if ($object->getData($attributeName) === null && $defaultValue !== null) {
60+
if ($object->getData($attributeName) === null
61+
&& $defaultValue !== null
62+
&& !$object->hasData($attributeName)) {
6163
$object->setData($attributeName, $defaultValue);
6264
$object->setData($attributeName . '_is_formated', true);
6365
}
6466

67+
6568
return $this;
6669
}
6770

0 commit comments

Comments
 (0)