From 0ee3995d8c67f172adc03fae1510be5141b3bae9 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Thu, 10 Nov 2016 13:26:27 +0100
Subject: [PATCH] [BUGFIX] Re-enable "default" option in Fluid Case ViewHelper

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
index ffb09635226b..b9d4586bf118 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/CaseViewHelper.php
@@ -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');
-- 
GitLab