Issue Bug Closed

#88934TypolinkViewHelper: Links to disabled pages in another language

Chris Müller 08/08/19, 09:12 updated 11/06/26, 10:28

Description

I am using the URI\TypolinkViewHelper in a Fluid template to generate a link from, e.g. t3://page?uid=42 (which an editor entered in a backend form field).

*Correct behaviour:*
When there is a link from a page in the default language (let’s take English) to a page of the same language which is disabled, the TypolinkViewHelper returns an empty string. So I can check and hide the link and its text. That’s okay.

*Wrong behaviour:*
Now I have a link in another language (e.g. German) to a disabled page in the same language (e.g. with the slug /german-page-slug). The TypolinkViewHelper returns a string which looks like /de/english-page-slug, which is wrong and results in a 404 page when following in the browser. But I expect the same behaviour as in the default language: returning an empty string.

In site configuration the fallback type of the language is set to strict.

I debugged the issue, and came to the PageRepository: In the getPagesOverlay method the overlay is identified, which is empty in the case. After that the output pages are assigned, the original page is set and if there is an overlay, it overwrites the original page fields. But if the overlay is empty, the original page fields are returned.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 6

  1. Chris Müller changed subject TypolinkViewHelper: Links to hidden pages in another language TypolinkViewHelper: Links to disabled pages in another language <span data-processor="relativetime" data-value="2019-08-08T22:41:44+00:00" > 08/08/19, 22:41 </span>

  2. Thomas Luzat commented <span data-processor="relativetime" data-value="2019-12-29T18:31:02+00:00" > 12/29/19, 18:31 </span>

    I seem to have stumbled across the same problem. Using fe_login in a non-default language a redirect URL is being generated with the slug coming from the default language. Given that the target is not accessible before the user is logged in, the generation runs into the same problem.

    Default language (german): /benutzer
    Alternative language (english): /en/benutzer
    Expected: /en/user

    In the fe_login case my workaround was to disable redirect_url handling, which I currently don’t need, but this is not really a solution. In TYPO3 9.5.13 this happens in PageLinkBuilder::build(), line 205:

    $page = $pageRepository->getPageOverlay($page);

    I am wondering whether it would be viable to disable all restrictions at this point or whether this might introduce bad semantics? getPage(s)Overlay could possibly gain an optional third parameter which allows specifying which restrictions to use.

  3. Nicole Hummel commented <span data-processor="relativetime" data-value="2023-01-13T15:30:16+00:00" > 01/13/23, 15:30 </span>

    I can confirm that link building in a situation like described is still broken in TYPO3 11.5

  4. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-06T10:28:20+00:00" > 11/06/26, 10:28 </span>

    Cannot reproduce this on current main. With fallbackType: strict, a typolink to a page whose translation is hidden now returns an empty URL (UnableToLinkException in PageLinkBuilder), same as for a hidden default-language page. With fallbackType: fallback the link points to the default-language slug under the language prefix, and that URL resolves correctly (no 404). Links to access-restricted pages with linkAccessRestrictedPages use the translated slug. Closing — please reopen with a reproducible setup if it still occurs on 13.4/14.x.