Commit bd6ab528 authored by Georg Ringer's avatar Georg Ringer
Browse files

[BUGFIX] Do not show empty dates of system news

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's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Torben Hansen's avatarTorben Hansen <derhansen@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Torben Hansen's avatarTorben Hansen <derhansen@gmail.com>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 6db43aa0
...@@ -467,7 +467,7 @@ class LoginController ...@@ -467,7 +467,7 @@ class LoginController
foreach ($systemNewsRecords as $systemNewsRecord) { foreach ($systemNewsRecords as $systemNewsRecord) {
$systemNews[] = [ $systemNews[] = [
'uid' => $systemNewsRecord['uid'], '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'], 'header' => $systemNewsRecord['title'],
'content' => $systemNewsRecord['content'] 'content' => $systemNewsRecord['content']
]; ];
......
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
<f:section name="Item"> <f:section name="Item">
<p id="loginNewsItem-{item.uid}" class="typo3-login-news-heading">{item.header}</p> <p id="loginNewsItem-{item.uid}" class="typo3-login-news-heading">{item.header}</p>
<f:format.html>{item.content}</f:format.html> <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> </f:section>
</html> </html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment