Project

General

Profile

Actions

Bug #88934

open

TypolinkViewHelper: Links to disabled pages in another language

Added by Chris Müller over 4 years ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-08-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Story #101565: Frontend related translation issuesNew2023-08-03

Actions
Actions #1

Updated by Chris Müller over 4 years ago

  • Subject changed from TypolinkViewHelper: Links to hidden pages in another language to TypolinkViewHelper: Links to disabled pages in another language
Actions #2

Updated by Chris Müller over 4 years ago

  • Description updated (diff)
Actions #3

Updated by Thomas Luzat over 4 years ago

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.

Actions #4

Updated by Nicole Cordes over 1 year ago

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

Actions #5

Updated by Astrid Haubold 6 months ago

  • Related to Story #101565: Frontend related translation issues added
Actions

Also available in: Atom PDF