[BUGFIX] Cast floor’ed division to int 26/56726/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 18 Apr 2018 13:33:16 +0000 (15:33 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Wed, 18 Apr 2018 13:44:38 +0000 (15:44 +0200)
The division is rounded by a `floor()` call. Since `floor()` returns a
value of type `double`, the result must get casted to an integer to have
the strict comparisons functional again.

Resolves: #84782
Related: #83556
Releases: master
Change-Id: Ief5d154f0447d2826c013c8cadb792ceb2288320
Reviewed-on: https://review.typo3.org/56726
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php

index fca39c3..2959113 100644 (file)
@@ -341,7 +341,7 @@ abstract class AbstractFormElement extends AbstractNode
      */
     protected function calculateColumnMarkup(int $cols): array
     {
-        $colWidth = floor(12 / $cols);
+        $colWidth = (int)floor(12 / $cols);
         $colClass = 'col-md-12';
         $colClear = [];
         if ($colWidth === 6) {