[BUGFIX] Do not show empty dates of system news
authorGeorg Ringer <georg.ringer@gmail.com>
Sun, 18 Jul 2021 05:57:05 +0000 (07:57 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 30 Jul 2021 18:02:33 +0000 (20:02 +0200)
If the creation date of a system news is cleared by an editor, the
rendered news must skip the date.

Resolves: #94576
Releases: master, 10.4
Change-Id: I93958ba0e858960dba4b99c0123cedce7dba5539
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69908
Tested-by: Nikita Hovratov <nikita.h@live.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Guido Schmechel <guido.schmechel@brandung.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Torben Hansen <derhansen@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Nikita Hovratov <nikita.h@live.de>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Torben Hansen <derhansen@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Controller/LoginController.php
typo3/sysext/backend/Resources/Private/Partials/LoginNews.html

index 538b93d..3a4f1ae 100644 (file)
@@ -467,7 +467,7 @@ class LoginController
         foreach ($systemNewsRecords as $systemNewsRecord) {
             $systemNews[] = [
                 'uid' => $systemNewsRecord['uid'],
-                'date' => date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], (int)$systemNewsRecord['crdate']),
+                'date' => $systemNewsRecord['crdate'] ? date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], (int)$systemNewsRecord['crdate']) : '',
                 'header' => $systemNewsRecord['title'],
                 'content' => $systemNewsRecord['content']
             ];
index 019b3e2..5a4f6bd 100644 (file)
@@ -37,6 +37,6 @@
 <f:section name="Item">
     <p id="loginNewsItem-{item.uid}" class="typo3-login-news-heading">{item.header}</p>
     <f:format.html>{item.content}</f:format.html>
-    <p class="text-muted"><span class="sr-only"><f:translate key="login.news.date"/></span>{item.date}</p>
+    <f:if condition="{item.date}"><p class="text-muted"><span class="sr-only"><f:translate key="login.news.date"/></span>{item.date}</p></f:if>
 </f:section>
 </html>