Project

General

Profile

Actions

Bug #97260

open

Shortcut not rendered in menu if target page is hidden for menus

Added by Philipp Idler about 2 years ago. Updated 11 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Pagetree
Target version:
-
Start date:
2022-03-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

You have two pages:

- Page 1 (visible for menus, shortcut to Page 2)
- Page 2 (hidden for menus)

Current behavior:
  • Page 1 isn't rendered in menu
  • Page 2 isn't rendered in menu
Expected behavior:
  • 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

Cattura1.png (23.1 KB) Cattura1.png Riccardo De Contardi, 2023-06-18 14:43
Actions #1

Updated by Philipp Idler about 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.

Actions #2

Updated by Philipp Idler about 2 years ago

  • Description updated (diff)
Actions #3

Updated by Philipp Idler about 2 years ago

  • Description updated (diff)
Actions #4

Updated by Philipp Idler about 2 years ago

  • Description updated (diff)
Actions #5

Updated by Riccardo De Contardi 11 months ago

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

test-97260-1 > edit >
  • 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.

Actions

Also available in: Atom PDF