[BUGFIX] Add needed setting to handle file_references correctly
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 26 Dec 2012 08:44:43 +0000 (09:44 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 26 Mar 2013 22:07:45 +0000 (23:07 +0100)
The Uri.Image ViewHelper needs the setting 'treatIdAsReference' to
handle file_references correctly.

Change-Id: Ia3df9dffd801e5f88343d60bcc352e39e89179ee
Fixes: #44222
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/17274
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php

index a202a1a..c8b7f5c 100644 (file)
@@ -86,10 +86,11 @@ class ImageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelpe
         * @param integer $minHeight minimum height of the image
         * @param integer $maxWidth maximum width of the image
         * @param integer $maxHeight maximum height of the image
+        * @param boolean $treatIdAsReference given src argument is a sys_file_reference record
         * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
         * @return string path to the image
         */
-       public function render($src, $width = NULL, $height = NULL, $minWidth = NULL, $minHeight = NULL, $maxWidth = NULL, $maxHeight = NULL) {
+       public function render($src, $width = NULL, $height = NULL, $minWidth = NULL, $minHeight = NULL, $maxWidth = NULL, $maxHeight = NULL, $treatIdAsReference = FALSE) {
                if (TYPO3_MODE === 'BE') {
                        $this->simulateFrontendEnvironment();
                }
@@ -99,7 +100,8 @@ class ImageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelpe
                        'minW' => $minWidth,
                        'minH' => $minHeight,
                        'maxW' => $maxWidth,
-                       'maxH' => $maxHeight
+                       'maxH' => $maxHeight,
+                       'treatIdAsReference' => $treatIdAsReference
                );
                if (TYPO3_MODE === 'BE' && substr($src, 0, 3) === '../') {
                        $src = substr($src, 3);
@@ -153,4 +155,4 @@ class ImageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelpe
        }
 }
 
-?>
\ No newline at end of file
+?>