From 8be8e84dbcc91981da3993e3a516c2415afc9c87 Mon Sep 17 00:00:00 2001
From: Wouter Wolters <typo3@wouterwolters.nl>
Date: Tue, 29 Sep 2015 19:18:26 +0200
Subject: [PATCH] [TASK] Cleanup AbstractFormElement usage of $listFlag

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>
---
 .../Classes/Form/Element/AbstractFormElement.php  | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php b/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
index 94935d01fec6..2d0540992f8d 100644
--- a/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
+++ b/typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
@@ -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
-- 
GitLab