Issue Bug Closed

#90842FE user restriction on pages and link incl. linkAccessRestrictedPages create wrong URLs

Tim Lochmüller 03/26/20, 14:44 updated 05/12/20, 13:08

Description

Hey guys,

I have a page with frontend user restriction and try to link to this page.
The default language link is right, but the links in all other languages are wrong (language segment + default language slug)

Example: (tested with TYPO3 9.5.14)
<f:link pageuid="{PID_OF_FE_USER_RESTRICTED_PAGE}" linkaccessrestrictedpages="1">LINK</f:link>

*Expected result:*
DE: /startseite
EN: /en/home

*Current result:*
The link on a english page is: /en/startseite (the correct language segment, but the default language slug)

Reason:

The function \TYPO3\CMS\Frontend\Typolink\PageLinkBuilder->build respect “linkAccessRestrictedPages” in $disableGroupAccessCheck
but this variable is only used for the page selection AND NOT for the page language overlay in this line: $pageRepository->getPageOverlay($page);

*More details:*
_\TYPO3\CMS\Frontend\Page\PageRepository->getPageOverlaysForLanguageUids_ uses always this restriction in the selection:
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));

So currently “linkAccessRestrictedPages” is not working with multi language setups.

Any help or ideas for a good solution?

Regards,
Tim

Reviews 2