[BUGFIX] Fix image descriptions for renderMethod = table 96/41396/2
authorTorben Hansen <derhansen@gmail.com>
Thu, 16 Jul 2015 08:12:07 +0000 (10:12 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 22 Jul 2015 12:31:12 +0000 (14:31 +0200)
Image descriptions are not rendered correctly using
renderMethod = table, since only the description of the
last image is rendered when you have multiple images
in a content object..

This patch loads the current image file reference to the
contentObjectRenderer while looping through all images
in order to output the image descriptions.

Resolves: #68153
Releases: master, 6.2
Change-Id: I273fff90a5ab3a35e6422ca74b6d83b298b9b09d
Reviewed-on: http://review.typo3.org/41396
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/compatibility6/Classes/ContentObject/ImageTextContentObject.php

index 4073764..bc82fce 100644 (file)
@@ -361,6 +361,9 @@ class ImageTextContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractC
                                                $GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgIndex;
                                                $imgIndex = $index + $a * $colCount_temp;
                                                $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgIndex;
+                                               if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($imgs[$imgIndex])) {
+                                                       $this->setCurrentFileInContentObjectRenderer(intval($imgs[$imgIndex]));
+                                               }
                                                if ($imgsTag[$imgIndex]) {
                                                        // Puts distance between the images IF "noRows" is set and this is the first iteration of the loop
                                                        if ($rowspacing && $noRows && $a) {