[BUGFIX] Fix selected node count in select tree
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Form / Element / SelectTreeElement.php
index 75b42d2..0faca43 100644 (file)
@@ -45,9 +45,9 @@ class SelectTreeElement extends AbstractFormElement {
 
                $possibleSelectboxItems = $config['items'];
 
-               $selectedNodes = array();
-               if (!empty($parameterArray['itemFormElValue'])) {
-                       $selectedNodes = $parameterArray['itemFormElValue'];
+               $selectedNodes = $parameterArray['itemFormElValue'];
+               if ($config['maxitems'] === 1 && count($selectedNodes) === 1 && empty($selectedNodes[0])) {
+                       $selectedNodes = array();
                }
 
                $selectedNodesForApi = array();