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 #1

Updated by Dominik Heun 10 months ago

Hello Guys,
i found an issue which seems related to the above description.

My Issue is at HMENU Generation, which probably occurs since this BUGFIX: https://github.com/TYPO3/typo3/commit/ad3856650d5d77a03dee08654eddb4305d576998

You can test this by creating a Page with two Subpages. Like this:

Page 1 - Shortcut to Subpage 1

Subpage 1
Subpage 2

Now we have translations for all the pages. We disable Subpage 1 and change the Shortcut within the translated Page 1 to Subpage 2. Like this:

Page 1 - Shortcut to Subpage 2

Subpage 1 - Disabled
Subpage 2

If we have a basic Typoscript HMENU and have a look at the menu in the frontend, we are not getting a a-Tag around the "Page 1". I debugged the code to the function resolvePage in the PageLinkBuilder. If i see it correctly the Problem is, that the language, which is given in the $configuration Parameter is ignored completely.

Actions #2

Updated by Astrid Haubold 6 months ago

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

Also available in: Atom PDF