From 0fac107d31f7a59c8aa90872e52e17de08e4db74 Mon Sep 17 00:00:00 2001 From: Kevin Abel Date: Mon, 22 Dec 2014 13:18:16 -0600 Subject: [PATCH] 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. --- app/code/Magento/Email/Model/Resource/Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Email/Model/Resource/Template.php b/app/code/Magento/Email/Model/Resource/Template.php index f4cf0242b5467..6c6fe926b97cc 100644 --- a/app/code/Magento/Email/Model/Resource/Template.php +++ b/app/code/Magento/Email/Model/Resource/Template.php @@ -99,7 +99,7 @@ public function checkCodeUsage(\Magento\Email\Model\Template $template) protected function _beforeSave(AbstractModel $object) { if ($object->isObjectNew()) { - $object->setCreatedAt($this->dateTime->formatDate(true)); + $object->setAddedAt($this->dateTime->formatDate(true)); } $object->setModifiedAt($this->dateTime->formatDate(true)); $object->setTemplateType((int)$object->getTemplateType());