Bug #83581

Logical error while checking validity of a shortcut

Added by David Otto over 1 year ago. Updated 2 months ago.

Status:
New
Priority:
Must have
Category:
Frontend
Start date:
2018-01-16
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

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).

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

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

#2 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55378

#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

#4 Updated by Gerrit Code Review over 1 year ago

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

#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 additionalWhere.
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.

#7 Updated by Riccardo De Contardi about 1 year ago

  • Status changed from Needs Feedback to New

#8 Updated by Benni Mack 2 months ago

  • Target version changed from next-patchlevel to Candidate for patchlevel

Also available in: Atom PDF