Bug #97260
closedShortcut not rendered in menu if target page is hidden for menus
0%
Description
You have two pages:
- Page 1 (visible for menus, shortcut to Page 2)
- Page 2 (hidden for menus)
- Page 1 isn't rendered in menu
- Page 2 isn't rendered in menu
- Page 1 is rendered in menu
- Page 2 isn't rendered in menu
If a shortcut is set to "visible in menus" (nav_hide is false) an editor expects page to be rendered in menus.
Files
Updated by Philipp Idler over 2 years ago
In the PageRepository is a method to check visibility of shortcut target:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Domain/Repository/PageRepository.php#L930
This method is called by passing $additionalWhereClause of parent method to exclude certain pages (doktypes, nav_hide, ...) but this additional clauses do NOT match for this method's purpose in my opinion.
The method should only check wether the target page is accessible (check access rights, deleted, disabled) and nothing else.
The argument $additionalWhereClause should therefore be removed from method's signature.
Updated by Riccardo De Contardi over 1 year ago
- File Cattura1.png Cattura1.png added
- Status changed from New to Needs Feedback
Can we have a scenario where this does not work? I tried the following test with TYPO3 10.4.37
1) I created 3 pages:
test-visibility
test-97260-1
test-97260-2
test-97260-2 > edit > access tab > Page enabled in menus [nav_hide]
: 1
- Type
[doktype]
: shortcut[4]
- Shortcut Mode
[shortcut_mode]
: Selected page [0] - Select the page "test-97260-2"
Result as shown here:
"test-visibility" > create a new content element, type: "Menu of these pages"; select the two pages "test-97260-1" and "test-97260-2"
Visit the page on the frontend
Result:¶
Only the page "test-97260-1" is rendered on the menu.
I also tried with building a very simple TypoScript menu like:
page.20 = HMENU page.20 { 1 = TMENU 1.expAll = 1 1.wrap = <ul>|</ul> 1.NO.wrapItemAndSub = <li>|</li> 2 < .1 3 < .1 }
and the result is the same.
The same test has been repeated on TYPO3 13.0.0-dev with the same results (did not tried with version 11 and 12)
Is there something I am missing or a different test is necessary? Thank you for your feedback.
Updated by Riccardo De Contardi 6 months ago
- Status changed from Needs Feedback to Closed
I close this issue as resolved.
If you think that this is the wrong decision or experience the issue again please reopen it or open a new issue with a reference to this one.
Thank you.