[BUGFIX] Separators shown in explicit allow/deny section 18/54018/2
authorOliver Hader <oliver@typo3.org>
Fri, 8 Sep 2017 10:49:01 +0000 (12:49 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 8 Sep 2017 13:06:24 +0000 (15:06 +0200)
The explicit allow/deny section of backend user groups (be_groups)
render separators (--div--) in the backend which need to be skipped.

Change-Id: Iac578d43a7a561618d095819b9d667c613621f2b
Resolves: #82379
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54018
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php

index 4fda004..08d3ef2 100644 (file)
@@ -906,33 +906,35 @@ abstract class AbstractItemProvider
                                 $languageService->sL($GLOBALS['TCA'][$table]['ctrl']['title']) . ': '
                                 . $languageService->sL($GLOBALS['TCA'][$table]['columns'][$field]['label']);
                             foreach ($fieldConfig['items'] as $iVal) {
-                                // Values '' is not controlled by this setting.
-                                if ((string)$iVal[1] !== '') {
-                                    // Find iMode
-                                    $iMode = '';
-                                    switch ((string)$fieldConfig['authMode']) {
-                                        case 'explicitAllow':
+                                $itemIdentifier = (string)$iVal[1];
+                                // Values '' and '--div--' are not controlled by this setting.
+                                if ($itemIdentifier === '' || $itemIdentifier === '--div--') {
+                                    continue;
+                                }
+                                // Find iMode
+                                $iMode = '';
+                                switch ((string)$fieldConfig['authMode']) {
+                                    case 'explicitAllow':
+                                        $iMode = 'ALLOW';
+                                        break;
+                                    case 'explicitDeny':
+                                        $iMode = 'DENY';
+                                        break;
+                                    case 'individual':
+                                        if ($iVal[4] === 'EXPL_ALLOW') {
                                             $iMode = 'ALLOW';
-                                            break;
-                                        case 'explicitDeny':
+                                        } elseif ($iVal[4] === 'EXPL_DENY') {
                                             $iMode = 'DENY';
-                                            break;
-                                        case 'individual':
-                                            if ($iVal[4] === 'EXPL_ALLOW') {
-                                                $iMode = 'ALLOW';
-                                            } elseif ($iVal[4] === 'EXPL_DENY') {
-                                                $iMode = 'DENY';
-                                            }
-                                            break;
-                                    }
-                                    // Set iMode
-                                    if ($iMode) {
-                                        $allowDenyOptions[$table . ':' . $field]['items'][$iVal[1]] = [
-                                            $iMode,
-                                            $languageService->sL($iVal[0]),
-                                            $adLabel[$iMode]
-                                        ];
-                                    }
+                                        }
+                                        break;
+                                }
+                                // Set iMode
+                                if ($iMode) {
+                                    $allowDenyOptions[$table . ':' . $field]['items'][$itemIdentifier] = [
+                                        $iMode,
+                                        $languageService->sL($iVal[0]),
+                                        $adLabel[$iMode]
+                                    ];
                                 }
                             }
                         }