[BUGFIX] Respect showAccessRestrictedPages in MenuProcessor 14/57114/2
authorFrederik Holz <frederik.holz@gmail.com>
Wed, 2 May 2018 15:41:09 +0000 (17:41 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sat, 2 Jun 2018 21:24:26 +0000 (23:24 +0200)
Menues provided by MenuProcessor will display restricted
pages, if the configuration value is set to true. This is the
same behavior as known from pure TypoScript provided menues.

Resolves: #82755
Releases: master, 8.7
Change-Id: Idf600f3ce151e2accba828c69dc601e26771686c
Reviewed-on: https://review.typo3.org/57114
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/frontend/Classes/DataProcessing/MenuProcessor.php

index 693b64a..2e7534e 100644 (file)
@@ -94,6 +94,8 @@ class MenuProcessor implements DataProcessorInterface
         'begin.',
         'alternativeSortingField',
         'alternativeSortingField.',
+        'showAccessRestrictedPages',
+        'showAccessRestrictedPages.',
         'excludeUidList',
         'excludeUidList.',
         'excludeDoktypes',
@@ -356,6 +358,13 @@ class MenuProcessor implements DataProcessorInterface
             if ($i > 1) {
                 $this->menuConfig[$i . '.']['stdWrap.']['wrap'] = ',"children": [|]';
             }
+            if (array_key_exists('showAccessRestrictedPages', $this->menuConfig)) {
+                $this->menuConfig[$i . '.']['showAccessRestrictedPages'] = $this->menuConfig['showAccessRestrictedPages'];
+                if (array_key_exists('showAccessRestrictedPages.', $this->menuConfig)
+                    && is_array($this->menuConfig['showAccessRestrictedPages.'])) {
+                    $this->menuConfig[$i . '.']['showAccessRestrictedPages.'] = $this->menuConfig['showAccessRestrictedPages.'];
+                }
+            }
             $this->menuConfig[$i . '.']['expAll'] = $this->menuExpandAll;
             $this->menuConfig[$i . '.']['alternativeSortingField'] = $this->menuAlternativeSortingField;
             $this->menuConfig[$i . '.']['NO'] = '1';