From 0edfbc609658e2922974503fc00a6cb75d587d7e Mon Sep 17 00:00:00 2001 From: Olkhovatov Andrey Date: Fri, 29 Jan 2021 16:23:50 +0200 Subject: [PATCH] fix: save post wthout date --- Controller/Adminhtml/Post/Save.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Controller/Adminhtml/Post/Save.php b/Controller/Adminhtml/Post/Save.php index a4ec372..4b7ef9f 100644 --- a/Controller/Adminhtml/Post/Save.php +++ b/Controller/Adminhtml/Post/Save.php @@ -58,6 +58,9 @@ public function execute() if (!$data['is_short_content']) { $model->setShortContent(''); } + if (!$data[PostInterface::CREATED_AT]) { + $model->setCreatedAt(date('Y-m-d H:i:s')); + } try { if ($this->getRequest()->getParam('isAjax')) {