From 430befa3c4fff495c76692ba372fe6492d2d1f19 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 15 May 2021 12:04:10 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9publication=20champ=20non=20saisi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/news/news.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/news/news.php b/module/news/news.php index 46f4042a..f03767ef 100755 --- a/module/news/news.php +++ b/module/news/news.php @@ -136,10 +136,12 @@ class news extends common { if($this->isPost()) { // Crée la news $newsId = helper::increment($this->getInput('newsAddTitle', helper::FILTER_ID), (array) $this->getData(['module', $this->getUrl(0)])); + $publishedOn = $this->getInput('newsAddPublishedOn', helper::FILTER_DATETIME, true); + $publishedOff = $this->getInput('newsAddPublishedOff' ) ? $this->getInput('newsEditPublishedOff', helper::FILTER_DATETIME) : ''; $this->setData(['module', $this->getUrl(0),'posts', $newsId, [ 'content' => $this->getInput('newsAddContent', null), - 'publishedOn' => $this->getInput('newsAddPublishedOn', helper::FILTER_DATETIME, true), - 'publishedOff' => $this->getInput('newsAddPublishedOff', helper::FILTER_DATETIME), + 'publishedOn' => $publishedOn, + 'publishedOff' => $publishedOff, 'state' => $this->getInput('newsAddState', helper::FILTER_BOOLEAN), 'title' => $this->getInput('newsAddTitle', helper::FILTER_STRING_SHORT, true), 'userId' => $this->getInput('newsAddUserId', helper::FILTER_ID, true) @@ -331,7 +333,7 @@ class news extends common { $this->deleteData(['module', $this->getUrl(0),'posts', $this->getUrl(2)]); } $publishedOn = $this->getInput('newsEditPublishedOn', helper::FILTER_DATETIME, true); - $publishedOff = $this->getInput('newsEditPublishedOff', helper::FILTER_DATETIME); + $publishedOff = $this->getInput('newsEditPublishedOff' ) ? $this->getInput('newsEditPublishedOff', helper::FILTER_DATETIME) : ''; $this->setData(['module', $this->getUrl(0),'posts', $newsId, [ 'content' => $this->getInput('newsEditContent', null), 'publishedOn' => $publishedOn,