From 2d2f1ea3e8a47e1d2c972d87900d6950c4dcc2b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Annett=20J=C3=A4hnichen?= <mcmietz@web.de>
Date: Thu, 6 Jul 2023 14:33:01 +0200
Subject: [PATCH] [BUGFIX] Build view level link with page id in access module
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently, when selecting a level in the "View" menu,
the complete page tree is loaded starting from the root page,
because the link did not have an id of the currently selected page.
The id is now passed as an argument.

Resolves: #99885
Releases: main, 12.4
Change-Id: I45fe4abfdd68b5bce15ca9d7b540a2965de7fab4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79820
Tested-by: core-ci <typo3@b13.com>
Tested-by: Annett Jähnichen <mcmietz@web.de>
Reviewed-by: Annett Jähnichen <mcmietz@web.de>
---
 .../beuser/Classes/Controller/PermissionController.php       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/beuser/Classes/Controller/PermissionController.php b/typo3/sysext/beuser/Classes/Controller/PermissionController.php
index 56af74010f5c..14dbf71b2e1e 100644
--- a/typo3/sysext/beuser/Classes/Controller/PermissionController.php
+++ b/typo3/sysext/beuser/Classes/Controller/PermissionController.php
@@ -421,7 +421,10 @@ class PermissionController
                 $viewModeItems[] = GeneralUtility::makeInstance(DropDownRadio::class)
                     ->setActive($this->depth === $value)
                     ->setLabel($label)
-                    ->setHref((string)$this->uriBuilder->buildUriFromRoute('permissions_pages', ['depth' => $value]));
+                    ->setHref((string)$this->uriBuilder->buildUriFromRoute('permissions_pages', [
+                        'id' => $this->id,
+                        'depth' => $value,
+                    ]));
             }
             $viewModeButton = $buttonBar->makeDropDownButton()
                 ->setLabel($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.view'))
-- 
GitLab