Project

General

Profile

Actions

Bug #98506

open

typolink can't generate link to translated shortcut page while it should

Added by Christian Toffolo over 1 year ago. Updated 10 months ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Frontend
Start date:
2022-10-03
Due date:
% Done:

0%

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

Description

Steps to reproduce:
1. have a page (uid=123) doktype=4, shortcut_mode=0, shortcut=124
2. have a target page (uid=124) for page with uid=123
3. have another page (uid=125)
4. translate this page with uid=125, this translation has uid=126
5. translate page of point 1 (page with uid=123), this translation has uid=127 and is set: doktype=4, shortcut_mode=0, shortcut=125

In other words:

123/ shortcut to 124 in default translation; has translation uid=127 with shortcut to 125
├─ 124/
├─ 125/ has translation uid=126

With this page setup, try to generate a typolink of page 123 in translated language.

typolink {
    parameter = 123
    useCacheHash = 1
    returnLast = url
}

This typolink will return the correct url of page with uid=124 in default language, but will not return the url of page with uid=125 in translated language. Instead it will return the title of page with uid=127 causing a 404.

So there are two problems here:
1. typolink doesn't generate a URL while it should
2. typolink returns a page title as a URL and, AFAIK, it's not possible to disable this behaviour and simply not generate the URL.

As far as I debugged, problem 1 is caused because \TYPO3\CMS\Frontend\Typolink\PageLinkBuilder::build tries to get the page overlay of the shortcut of default language of page 123, that is page 124, instead of the overlay of the shortcut of the translation of page 123, that is page 127, so the overlay should be the one of page 125.


Related issues 1 (1 open0 closed)

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

Actions
Actions

Also available in: Atom PDF