Project

General

Profile

Actions

Bug #90100

open

Linking cross-site to page uid with different languages doesn't work

Added by Koen Wouters over 4 years ago. Updated about 1 year ago.

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

0%

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

Description

I have a multi site installation with for each siteroot different languages configured.
Siteroot 1: English (default) and German
Siteroot 2: English (default)

I use the link builder to make a link from an element inside siteroot 1 (German) to a page uid inside siteroot 2. This results in no link in the frontend of siteroot 1 (German), because the german language doesn't exist inside siteroot 2.
What i expect is a link in the frontend of siteroot 1 (German) to the default language of siteroot 2 so i won't miss links in the frontend of siteroot 1. Or i want an option to choose the target language in the link builder, so an editor can choose the target language. For now i am using a bypass by creating an external url to create hard links to the siteroot 2 English, but this is not how this should work in my opinion.


Files

90100-linking_cross_site.diff (1.08 KB) 90100-linking_cross_site.diff Martin Tepper, 2021-08-05 08:27

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #22113: Possibility to link to an explicit language of a pageClosed2010-02-12

Actions
Actions #1

Updated by Riccardo De Contardi about 4 years ago

  • Related to Feature #22113: Possibility to link to an explicit language of a page added
Actions #2

Updated by Riccardo De Contardi about 4 years ago

I report an extension that might be of help: https://github.com/CMSExperts/link2language

Actions #3

Updated by Heiko Nöthen almost 4 years ago

I can confirm that this problem still exists in the current TYPO3 9 version.

Given:
default.de German/de (default) and English
default.en English (default)

If you create a typolink from default.de/en/somesite to default.en/othersite you get no link cause function getSiteLanguageOfTargetPage in PageLinkBuilder.php [1] treats this as an error case. There is no language with the given id in this site. But i think there should be at least an option to set the default language as a default or fallback.

It is great that it is possible in TYPO3 V9 to only activate nessesary languages and to use LanguageMenuProcessor to generate the language menu automaticaly.

Espacialy if there is a site with default English language it makes no sence to additionaly activate the English language in the site configuration. But currently that would be the only build in solution. That would cause thousands of unneeded Urls and the menu couldn't be generated automaticaly. No solution for me.

To solve the problem i currently use the typolinkModifyParameterForPageLinks hook.

Solution ideas:

a) Option to fallback to default

b) Option to fallback to defined language

Example:

Given:
Site A: default German site and English
Site B: default English site and Chinese(zh)

Creating a link from site.b/zh/ to Site A would cause no link. A fallback to default German is not the best solution. So i think there should be an option to fallback to English.

[1] https://api.typo3.org/9.5/_page_link_builder_8php_source.html#l00352

Actions #4

Updated by Francois Suter over 3 years ago

I have stumbled on this problem too and I consider it a bug. I think the link generation should fall back to the default language site, because this makes for a better user experience than no link at all.

Actions #5

Updated by Martin Tepper over 2 years ago

I can confirm this too.
Wrote a rudimentary patch for TYPO3 10.4.

Actions #6

Updated by Friedemann Altrock about 1 year ago

I have the same problem.

We have multiple sites, one of them is now being translated. Links are generated with an empty URL/href when the current language is not present in the target site. The solution should respect the fallbacks configured in the current site language.

Like this: https://github.com/TYPO3/typo3/commit/d73711fcad6bca7a4bf873f5c96d1fbb017cfd44

(... guess I should finally learn how to contribute patches to TYPO3.)

Actions

Also available in: Atom PDF