Skip to content

Commit 100e315

Browse files
committed
ACP2E-3486: Default values are not set for date and time attributes with products RestAPI
1 parent 80ceaa8 commit 100e315

File tree

1 file changed

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

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
6-
76
namespace Magento\Eav\Model\Entity\Attribute\Backend;
87

98
/**
@@ -58,7 +57,7 @@ public function beforeSave($object)
5857
}
5958

6059
$defaultValue = $this->getDefaultValue();
61-
if (is_null($object->getData($attributeName)) && $defaultValue !== null) {
60+
if ($object->getData($attributeName) === null && $defaultValue !== null) {
6261
$object->setData($attributeName, $defaultValue);
6362
$object->setData($attributeName . '_is_formated', true);
6463
}

0 commit comments

Comments
 (0)