[BUGFIX] Show FAL captions in Page module 99/36099/2
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Wed, 14 Jan 2015 16:00:49 +0000 (17:00 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 18 Jan 2015 19:13:09 +0000 (20:13 +0100)
The page module only showed the contents of the old field
tt_content.imagecaption.

With FAL in place we now show the description from the FAL references.

Resolves: #64281
Releases: 6.2, master
Change-Id: I868348e11e59dad3b2affc7114e3913e7f9e985a
Reviewed-on: http://review.typo3.org/36099
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index 5e26fbe..50b9625 100644 (file)
@@ -1492,8 +1492,14 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                        if ($row['CType'] == 'textpic' || $row['CType'] == 'image') {
                                                if ($row['image']) {
                                                        $out .= $this->thumbCode($row, 'tt_content', 'image') . '<br />';
-                                                       if ($row['imagecaption']) {
-                                                               $out .= $this->linkEditContent($this->renderText($row['imagecaption']), $row) . '<br />';
+                                                       $fileReferences = BackendUtility::resolveFileReferences('tt_content', 'image', $row);
+                                                       if (!empty($fileReferences)) {
+                                                               $linkedContent = '';
+                                                               foreach ($fileReferences as $fileReference) {
+                                                                       $linkedContent .= htmlspecialchars($fileReference->getDescription()) . '<br />';
+                                                               }
+                                                               $out .= $this->linkEditContent($linkedContent, $row);
+                                                               unset($linkedContent);
                                                        }
                                                }
                                        }