[BUGFIX] Render success message again in InfoboxViewHelper 83/45683/2
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 7 Jan 2016 16:40:01 +0000 (17:40 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 8 Jan 2016 09:50:39 +0000 (10:50 +0100)
The function forceIntegerInRange can't handle the value zero.
Use isIntegerInRange instead.

Resolves: #71562
Releases: master,7.6
Change-Id: Ia0e48774ff7b78d46116ad7d2d3348f5e0c65b1a
Reviewed-on: https://review.typo3.org/45683
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/fluid/Classes/ViewHelpers/Be/InfoboxViewHelper.php

index cfcd782..2aba677 100644 (file)
@@ -92,7 +92,12 @@ class InfoboxViewHelper extends AbstractViewHelper implements CompilableInterfac
     {
         $title = $arguments['title'];
         $message = $arguments['message'];
-        $state = MathUtility::forceIntegerInRange($arguments['state'], -2, 2, -2);
+        $state = $arguments['state'];
+        $isInRange = MathUtility::isIntegerInRange($state, -2, 2);
+        if (!$isInRange) {
+            $state = -2;
+        }
+
         $iconName = $arguments['iconName'];
         $disableIcon = $arguments['disableIcon'];
         if ($message === null) {