[TASK] Cleanup AbstractFormElement usage of $listFlag 30/43630/3
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 29 Sep 2015 17:18:26 +0000 (19:18 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 30 Sep 2015 10:21:35 +0000 (12:21 +0200)
Resolves: #70186
Releases: master
Change-Id: I6a9cfc9f3f82c4118fd078d99dc55b61916ce8f0
Reviewed-on: http://review.typo3.org/43630
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php

index 94935d0..2d05409 100644 (file)
@@ -131,7 +131,6 @@ abstract class AbstractFormElement extends AbstractNode {
 
                $fieldChangeFunc = $PA['fieldChangeFunc'];
                $item = $itemKinds[0];
-               $fName = '[' . $table . '][' . $row['uid'] . '][' . $field . ']';
                $md5ID = 'ID' . GeneralUtility::shortmd5($itemName);
                $fieldConfig = $PA['fieldConf']['config'];
                $prefixOfFormElName = 'data[' . $table . '][' . $row['uid'] . '][' . $field . ']';
@@ -140,17 +139,9 @@ abstract class AbstractFormElement extends AbstractNode {
                        $flexFormPath = str_replace('][', '/', substr($PA['itemFormElName'], strlen($prefixOfFormElName) + 1, -1));
                }
 
-               // Manipulate the field name (to be the TRUE form field name) and remove
-               // a suffix-value if the item is a selector box with renderMode "singlebox":
-               $listFlag = '_list';
-               if ($PA['fieldConf']['config']['type'] == 'select') {
-                       // Single select situation:
-                       if ($PA['fieldConf']['config']['maxitems'] <= 1) {
-                               $listFlag = '';
-                       } elseif ($PA['fieldConf']['config']['renderMode'] == 'singlebox') {
-                               $itemName .= '[]';
-                               $listFlag = '';
-                       }
+               // Add a suffix-value if the item is a selector box with renderMode "singlebox":
+               if ($PA['fieldConf']['config']['type'] === 'select' && (int)$PA['fieldConf']['config']['maxitems'] > 1 && $PA['fieldConf']['config']['renderMode'] === 'singlebox') {
+                       $itemName .= '[]';
                }
 
                // Contains wizard identifiers enabled for this record type, see "special configuration" docs