[BUGFIX] Do not manipulate minitems/maxitems 15/48415/4
authorMarkus Klein <markus.klein@typo3.org>
Tue, 31 May 2016 10:19:47 +0000 (12:19 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Sun, 5 Jun 2016 08:19:48 +0000 (10:19 +0200)
We must only manipulate minitems and maxitems for valdiation
when we have a select-field with renderType selectTree.
The existing check is not enough, since it lacks the check
for the actual type and applies the changes also if
any other type is used and minitems=maxitems=1.

Resolves: #76388
Releases: master, 7.6
Change-Id: I9697521a710c3debc49f40c2c4db87baac8f2d97
Reviewed-on: https://review.typo3.org/48415
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Form/AbstractNode.php

index 4fd9b2e..95d7019 100644 (file)
@@ -163,7 +163,7 @@ abstract class AbstractNode implements NodeInterface
             $minItems = (isset($config['minitems'])) ? (int)$config['minitems'] : 0;
             $maxItems = (isset($config['maxitems'])) ? (int)$config['maxitems'] : 10000;
             $type = ($config['type']) ?: 'range';
-            if ($config['renderType'] !== 'selectTree' && $maxItems <= 1 && $minItems > 0) {
+            if ($config['type'] === 'select' && $config['renderType'] !== 'selectTree' && $maxItems <= 1 && $minItems > 0) {
                 $validationRules[] = array(
                     'type' => $type,
                     'minItems' => 1,