[BUGFIX] Show FAL captions in Page module 13/36013/6
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:12:49 +0000 (20:12 +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/36013
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index f78c1bd..275d9d7 100644 (file)
@@ -1494,8 +1494,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);
                                                        }
                                                }
                                        }