[BUGFIX] Hide empty descriptions in textmedia in page module 95/53095/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Sat, 3 Jun 2017 15:30:39 +0000 (17:30 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 3 Jun 2017 16:04:29 +0000 (18:04 +0200)
In the Page module with textmedia content elements the descriptions
are shown below the thumbnails of linked media. If there is no
description an empty line is now suppressed.

Resolves: #81408
Releases: master, 8.7, 7.6
Change-Id: I9f342908f179550bcf2156328117c464bb8c672f
Reviewed-on: https://review.typo3.org/53095
Reviewed-by: Jo Hasenau <info@cybercraft.de>
Tested-by: Jo Hasenau <info@cybercraft.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/fluid_styled_content/Classes/Hooks/TextmediaPreviewRenderer.php

index 207391a..ca7c9c8 100644 (file)
@@ -55,7 +55,10 @@ class TextmediaPreviewRenderer implements PageLayoutViewDrawItemHookInterface
                     $linkedContent = '';
 
                     foreach ($fileReferences as $fileReference) {
-                        $linkedContent .= htmlspecialchars($fileReference->getDescription()) . '<br />';
+                        $description = $fileReference->getDescription();
+                        if ($description !== null && $description !== '') {
+                            $linkedContent .= htmlspecialchars($description) . '<br />';
+                        }
                     }
 
                     $itemContent .= $parentObject->linkEditContent($linkedContent, $row);