#91892linkAccessRestrictedPages (typolink setting) should only be considered when building link tags, not when building URIs
Description
linkAccessRestrictedPages of typolink is historically used to control whether procteded pages appear in menus for un-authenticated users, so it controlls whether an actual -tag is rendered or not.
In the modern days the typolink service is used for all kinds of URI building, for example in ext:redirects, where only pure URIs are generated, not full -tags.
If linkAccessRestrictedPages is not set it defaults to false, which in the case of ext:redirects leads to 404. In other cases it just returns an empty url, having unpredicatble consequences.
Also, one has to always think about setting linkAccessRestrictedPages => true explicitly, which is error prone.
I propose to change the behaviour in the core generally to only respect linkAccessRestrictedPages when building -Tags (like in typoscrip MENU objects, or in f:link ViewHelpers). In all other cases it should default to true.
If a developer or a redirect or some other tool explicitly requests the URL to a protected page this may not be empty or treated as 404. In fact the URL does exist and the API must return it thus. If the url is accessed the 403 handler jumps in anyways, which is the correct bahaviour.
You can also look at the name of this setting to understand this – it’s not named buildUriToAccessRestrictedPages but linkAccessRestrictedPages!
For example, returnLast = url should implicitly set linkAccessRestrictedPages = 1 if it is not explicitly set to 0 already.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 6
-
S P changed TYPO3 Version
910 <span data-processor="relativetime" data-value="2021-10-20T06:02:45+00:00" > 10/20/21, 06:02 </span> -
S P changed TYPO3 Version
1012 <span data-processor="relativetime" data-value="2024-12-17T09:45:56+00:00" > 12/17/24, 09:45 </span> -
S P changed TYPO3 Version
1213 <span data-processor="relativetime" data-value="2024-12-19T08:44:09+00:00" > 12/19/24, 08:44 </span> -
Georg Ringer commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-01T16:33:10+00:00" > 11/01/26, 16:33 </span>
The redirect case is fixed:
RedirectServicesetslinkAccessRestrictedPagessince #91879 (2696082580f in 11.1.0, ad978d800f9 in 10.4.13).The remaining behaviour is intended. TSref describes the option for typolinks in general, and the URI-only ViewHelpers
Defaulting it to true for URIs is also not safe:f:uri.pageandf:uri.actionhave the same argument with default false, so building a URI to a restricted page is an explicit opt-in.PageLinkBuilderdoes not know whether a tag or a URL is wanted, so the default would have to go into every consumer.config.typolinkLinkAccessRestrictedPages = <pid>(PageLinkBuilder::shouldModifyUrlForAccessRestrictedPage()).RecordsXmlSitemapDataProviderwith a restricted detail page.Globally,
config.typolinkLinkAccessRestrictedPages = NONEalready exists. Individual callers that really have to redirect to a restricted page should set the option themselves, as the redirect did. Please open a new issue for such a caller, or a feature request for a URL-only setting.