Skip to content

Commit 0fac107

Browse files
committed
Fix email template creation date not being persisted
The database schema from https://github.com/magento/magento2/blob/develop/app/code/Magento/Email/sql/email_setup/install-2.0.0.php#L62-L67 uses the column `added_at` for storing the date the email template creation date. When `setCreatedAt` is used, that date is not persisted to the database, leaving the column `NULL` in the database.
1 parent 35fea03 commit 0fac107

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Email/Model/Resource/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function checkCodeUsage(\Magento\Email\Model\Template $template)
9999
protected function _beforeSave(AbstractModel $object)
100100
{
101101
if ($object->isObjectNew()) {
102-
$object->setCreatedAt($this->dateTime->formatDate(true));
102+
$object->setAddedAt($this->dateTime->formatDate(true));
103103
}
104104
$object->setModifiedAt($this->dateTime->formatDate(true));
105105
$object->setTemplateType((int)$object->getTemplateType());

0 commit comments

Comments
 (0)