[BUGFIX] Re-enable "default" option in Fluid Case ViewHelper 75/50575/2
authorBenni Mack <benni@typo3.org>
Thu, 10 Nov 2016 12:26:27 +0000 (13:26 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 10 Nov 2016 12:54:17 +0000 (13:54 +0100)
A bug, introduced with the registerArguments option does
not work properly anymore with the "default" option for the <f:case>
viewhelper.

Casting the argument let's the option be evaluated again.

Resolves: #78638
Releases: master
Change-Id: I5b245378db4fab430fc0670b3a4a77de6c3b863f
Reviewed-on: https://review.typo3.org/50575
Reviewed-by: Claus Due <claus@phpmind.net>
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php

index ffb0963..b9d4586 100644 (file)
@@ -70,7 +70,7 @@ class CaseViewHelper extends AbstractViewHelper
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
         $value = $arguments['value'];
-        $default = $arguments['default'];
+        $default = (bool)$arguments['default'];
         $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
         if ($default !== false) {
             GeneralUtility::deprecationLog('Argument "default" on f:case is deprecated - use f:defaultCase instead');