Project

General

Profile

Actions

Bug #103017

closed

MenuProcessor is not showing access restricted pages, when all subpages are access restricted

Added by Sabrina Zwirner over 1 year ago. Updated 3 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Start date:
2024-02-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
MenuProcessor, showAccessRestrictedPages
Complexity:
Is Regression:
Sprint Focus:

Description

Hello,
I user the MenuProcessor to generate a menu that shows also access restricted pages.
Code looks like this:

 11 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
            11 {
                levels = 3
                includeSpacer = 1
                as = mainNavigation
                showAccessRestrictedPages = 1

                dataProcessing {
                    10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                    10 {
                        references.fieldName = media
                        as = navIcon
                    }
                }
            }

Now I have a Page "Products & Materials" that is not protected.
This page has two Subpages: "Shop" and "Materials", that are access protected.

The Menu is rendering "Products & Materials" but does not show the childrens "Shop" and "Materials".

As soon as I add at least one subpage that is not access protected,
all children will get rendered as they should.

Actions #1

Updated by Oliver Schmidt over 1 year ago

I have the same issue. A fix would be nice.

Actions #2

Updated by Garvin Hicking 11 months ago

  • Category set to Content Rendering
Actions #3

Updated by Lars Peter Søndergaard 8 months ago

I took a look at it, and the issue seems to be in the method:

\TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject::isSubMenu

Specifically the part:

if (!is_array($cachePagesNextLevel)) {
    $cachePagesNextLevel = $this->sys_page->getMenu($pageIdsOnSameLevel, 'uid,pid,doktype,mount_pid,mount_pid_ol,nav_hide,shortcut,shortcut_mode,l18n_cfg');
    $runtimeCache->set($cacheIdentifierPagesNextLevel, $cachePagesNextLevel);
}

Is not passing in $this->disableGroupAccessCheck as last argument to getMenu.

Adding it seems to fix this particular issue.

I only tried it by X-Classing the TextMenuContentObject class, so would be great if someone could fix it in actual core.

Greetings
Lars

Actions #4

Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88601

Actions #5

Updated by Gerrit Code Review 3 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88601

Actions #6

Updated by Gerrit Code Review 3 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88601

Actions #7

Updated by Gerrit Code Review 3 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88601

Actions #8

Updated by Gerrit Code Review 3 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88601

Actions #9

Updated by Gerrit Code Review 3 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88601

Actions #10

Updated by Gerrit Code Review 3 months ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/88824

Actions #11

Updated by Georg Ringer 3 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF