[BUGFIX] Use correct typoscript settings in ClickEnlargeViewHelper 70/43770/3
authorFrans Saris <franssaris@gmail.com>
Sat, 3 Oct 2015 20:34:09 +0000 (22:34 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 5 Oct 2015 19:31:25 +0000 (21:31 +0200)
The ClickEnlargeViewHelper receives typoscript settings in the extbase
format without the leading dots. The code called by the viewHelper
expects the typoscript syntax with the leadings dots.

This patch converts the settings array to a TypoScript array before
passing the settings to imageLinkWrap().

Change-Id: I19da35b10d079dddc19a18ecdff4ae8ebe1bdc9f
Resolves: #70317
Releases: master
Reviewed-on: http://review.typo3.org/43770
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Josef Glatz <jousch@gmail.com>
Tested-by: Josef Glatz <jousch@gmail.com>
Reviewed-by: Alexander Grein <alexander.grein@gmail.com>
Tested-by: Alexander Grein <alexander.grein@gmail.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Link/ClickEnlargeViewHelper.php

index a568089..01dedd6 100644 (file)
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\FluidStyledContent\ViewHelpers\Link;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Service\TypoScriptService;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
@@ -69,7 +71,7 @@ class ClickEnlargeViewHelper extends AbstractViewHelper {
         */
        static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
                $image = $arguments['image'];
-               $configuration = $arguments['configuration'];
+               $configuration = self::getTypoScriptService()->convertPlainArrayToTypoScriptArray($arguments['configuration']);
                $content = $renderChildrenClosure();
                $configuration['enable'] = TRUE;
 
@@ -82,4 +84,15 @@ class ClickEnlargeViewHelper extends AbstractViewHelper {
        static protected function getContentObjectRenderer() {
                return $GLOBALS['TSFE']->cObj;
        }
+
+       /**
+        * @return TypoScriptService
+        */
+       static protected function getTypoScriptService() {
+               static $typoScriptService;
+               if ($typoScriptService === NULL) {
+                       $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
+               }
+               return $typoScriptService;
+       }
 }