[BUGFIX] Correct automatic grid column calculation for forms 03/56103/5
authorBenjamin Kott <benjamin.kott@wfp2.com>
Mon, 12 Mar 2018 09:23:15 +0000 (10:23 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 12 Mar 2018 19:53:14 +0000 (20:53 +0100)
The calculation now only includes direct children of the
row elements to produce a meaningful division
of the available space. If the available space is already
consumed by elements the next auto calculated
elements will now consume the space of a full row.

Resolves: #84207
Releases: master, 8.7
Change-Id: I5dabddbcd8c7b84236fdbbef3925d27197e99a39
Reviewed-on: https://review.typo3.org/56103
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/form/Classes/ViewHelpers/GridColumnClassAutoConfigurationViewHelper.php

index 315a781..4ce9f83 100644 (file)
@@ -59,7 +59,7 @@ class GridColumnClassAutoConfigurationViewHelper extends AbstractViewHelper
 
         $gridRowElement = $formElement->getParentRenderable();
         $gridContainerElement = $gridRowElement->getParentRenderable();
-        $gridRowEChildElements = $gridRowElement->getElementsRecursively();
+        $gridRowEChildElements = $gridRowElement->getElements();
 
         if ($gridContainerElement instanceof GridContainerInterface) {
             $gridViewPortConfiguration = $gridContainerElement->getProperties()['gridColumnClassAutoConfiguration'];
@@ -110,7 +110,7 @@ class GridColumnClassAutoConfigurationViewHelper extends AbstractViewHelper
                 $restElements = (int)$columnsToCalculate[$viewPortName]['elements'];
 
                 if ($restColumnsToDivide < 1) {
-                    $restColumnsToDivide = 1;
+                    $restColumnsToDivide = $gridSize;
                 }
                 if ($restElements < 1) {
                     $restElements = 1;