Bug #98506
opentypolink can't generate link to translated shortcut page while it should
0%
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.
Updated by Dominik Heun over 1 year 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.
Updated by Astrid Haubold about 1 year ago
- Related to Story #101565: Frontend related translation issues added