[BUGFIX] Remove superfluous linebreaks in CE preview 98/38798/2
authorMarkus Klein <klein.t3@reelworx.at>
Sun, 19 Apr 2015 11:54:02 +0000 (13:54 +0200)
committerBenjamin Mack <benni@typo3.org>
Tue, 21 Apr 2015 19:52:29 +0000 (21:52 +0200)
Releases: master
Resolves: #66479
Change-Id: I93ac0eed83cf3a4dc26239a66b2ff69cd37d7580
Reviewed-on: http://review.typo3.org/38798
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/css_styled_content/Classes/Hooks/PageLayoutView/ImagePreviewRenderer.php
typo3/sysext/css_styled_content/Classes/Hooks/PageLayoutView/TextpicPreviewRenderer.php

index 9b2781a..172b645 100644 (file)
@@ -38,7 +38,7 @@ class ImagePreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDraw
        ) {
                if ($row['CType'] === 'image') {
                        if ($row['image']) {
-                               $itemContent .= $parentObject->thumbCode($row, 'tt_content', 'image') . '<br />';
+                               $itemContent .= $parentObject->thumbCode($row, 'tt_content', 'image');
 
                                $fileReferences = \TYPO3\CMS\Backend\Utility\BackendUtility::resolveFileReferences('tt_content', 'image', $row);
 
@@ -46,7 +46,10 @@ class ImagePreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDraw
                                        $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);
@@ -58,4 +61,4 @@ class ImagePreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDraw
                        $drawItem = FALSE;
                }
        }
-}
\ No newline at end of file
+}
index 2e45582..153d32e 100644 (file)
@@ -42,7 +42,7 @@ class TextpicPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDr
                        }
 
                        if ($row['image']) {
-                               $itemContent .= $parentObject->thumbCode($row, 'tt_content', 'image') . '<br />';
+                               $itemContent .= $parentObject->thumbCode($row, 'tt_content', 'image');
 
                                $fileReferences = \TYPO3\CMS\Backend\Utility\BackendUtility::resolveFileReferences('tt_content', 'image', $row);
 
@@ -50,7 +50,10 @@ class TextpicPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDr
                                        $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);
@@ -62,4 +65,4 @@ class TextpicPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDr
                        $drawItem = FALSE;
                }
        }
-}
\ No newline at end of file
+}