Logical error while checking validity of a shortcut
The function getSubpagesForPages in Class TYPO3\CMS\Frontend\Page\PageRepository uses the constraints given to filter the resulting subpages to also check if the target of a shortcut is valid. The validity of a shortcut target (as the comment line above the function call in question says: "If shortcut, look up if the target exists and is currently visible") should only depend on its existence and visibility and not any other constraints used to filter the result of getSubpagesOfPages (e.g. a shortcut itself).
#3 Updated by Stephan Großberndt over 1 year ago
To test this create a shortcut to a page (visible in menu), activate the 'hidden in menu'-option for the page itself and use it in a generated menu.
- before: the shortcut would not be displayed as part of the menu
- after: the shortcut will now be displayed corrertly as part of the menu
#5 Updated by Mathias Schreiber over 1 year ago
- Status changed from Under Review to Needs Feedback
Can you please describe the usecase in more detail?
$additionalWhere only applies if the respective
TMENU gets an
The entire point of
additionalWhere is to apply... well... an addition to the whereclause of all items of a menu.
If we removed constraint from TMENU we'd get the same bug report the other way around :)
Benni and I spent quite some time on trying to understand the usecase, but everything, we came up with, worked.
This is why we think your usecase is something we didn't think of.
Please share it, ideally with a couple of screenshots and the respective Typoscript Menu config.
#6 Updated by David Otto over 1 year ago
- Assignee changed from David Otto to Mathias Schreiber
In this case the additionalWherClause is applied to the checking of shortcut targets. This means all constraints are used on the targets. I understand this check just as the comment above it says "If shortcut, look up if the target exists and is currently visible". So checking for anything else is false logic in my opinion.
The exact use-case for me was a menu generated via VHS that stopped showing shortcuts to hidden in menu pages within the menu after upgrading from TYPO3 6.2 to 8.7. After a while i noticed, that checking if shourtcuts are existent and not deleted is absolutely fine, but using the menu constraints on the shortcut targets produces this behaviour.