[BUGFIX] Detect proper TsConfig for blinding settings in tree provider 71/58871/2
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 8 Nov 2018 09:44:38 +0000 (10:44 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 8 Nov 2018 19:33:06 +0000 (20:33 +0100)
Due the refactoring with #84993 the tsconfig coulnd't be loaded correctly if
a subarray must be accessed.

Resolves: #86882
Releases: master
Change-Id: Ie4450d77889d260a1d29f728ce3d0216736bb15a
Reviewed-on: https://review.typo3.org/58871
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/ContextMenu/ItemProviders/AbstractProvider.php

index 2e93d4b..b2ee866 100644 (file)
@@ -143,12 +143,12 @@ class AbstractProvider implements ProviderInterface
      */
     protected function initDisabledItems()
     {
-        $TSkey = $this->table . ($this->context ? '.' . $this->context : '');
-        $this->disabledItems = GeneralUtility::trimExplode(
-            ',',
-            $this->backendUser->getTSConfig()['options.']['contextMenu.']['table.'][$TSkey . '.']['disableItems'] ?? '',
-            true
-        );
+        if ($this->context) {
+            $tsConfigValue = $this->backendUser->getTSConfig()['options.']['contextMenu.']['table.'][$this->table . '.'][$this->context . '.']['disableItems'] ?? '';
+        } else {
+            $tsConfigValue = $this->backendUser->getTSConfig()['options.']['contextMenu.']['table.'][$this->table . '.']['disableItems'] ?? '';
+        }
+        $this->disabledItems = GeneralUtility::trimExplode(',', $tsConfigValue, true);
     }
 
     /**