#97260Shortcut not rendered in menu if target page is hidden for menus
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.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 6
-
Philipp Idler commented 03/30/22, 15:15
-
Philipp Idler changed description 03/30/22, 15:16
-
Philipp Idler changed description 03/30/22, 15:16
-
Philipp Idler changed description 03/30/22, 15:17
-
Riccardo De Contardi commented and changed attached Cattura1.png status
NewNeeds Feedback 06/18/23, 14:48Can 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-2test-97260-2 > edit > access tab > Page enabled in menus
test-97260-1 > edit >[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.
- Type
-
Riccardo De Contardi commented and changed status
Needs FeedbackClosed 06/08/24, 15:47I 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.
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.