Project

General

Profile

Actions

Bug #103658

open

LanguageMenuProcessor / (Routing) creates invalid links if a record is not translated

Added by Yannis Viol 7 months ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
Start date:
2024-04-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

The TYPO3-Core routing has problems with non existing record translations.

I have a site where all languages are configured with fallbackType: strict.

PersistedAliasMapper
If I want to generate a language menu with the LanguageMenuProcessor it generates links for records that are not translated and therefore lead to a 404 e.g. (/fr/about-us/media-news/actualites/detail/3669/).
If a translation exists the route is mapped correctly and replaces the uid in the url with the slug value.

Default
It just links to the default uri e.g. (/fr/about-us/media-news/actualites/detail/) also leading to a 404 (which is correct in theory)

So I debugged the Core until I found the Code where it struggles to handle the correct uri’s.

MappableProcessor.php::66 (called in PageRouter.php::349)
If a RouteEnhancer is passed here and has a empty value the generate method should throw a exception because otherwise it will generate a false uri in the PageRouter.php.
If this change is made it starts to render default uri’s for the plugin e.g.(tx_package_plugin…) hence we need some more changes because this still leads to a 404.

PageRouter::329
If at least one route is matching (RouteSorter -> PageRouter.php::329) it shouldn’t add the default router to the $allRoutes array. So I added this snippet for testing purposes:

if (count($allRoutes) > 1 && $allRoutes['default']) {
   unset($allRoutes['default']);
}

These changes fix it 99% somehow now in the language menu object the entries are marked as available but with an empty link so at the moment I have to check in the fluid like this:

<f:if condition="{language.available} && {language.link}">

It seems that this Bug is existing for quite a while already because i found several extensions that implemented classes to render a language menu on the detail view:
DisableLanguageMenuProcessor.php at main derhansen/sf_event_mgt
DisableLanguageMenuProcessor.php at main georgringer/news

Best Regards
Yannis


Files


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #91403: TYPO3 v9.5.17 and News v8.3.0 - 404 Error on detail pages from news-records, which are not translated to target language (Language Mode "Strict" or "Fallback)Closed2020-05-14

Actions
Actions #1

Updated by Markus Klein 7 months ago

  • Description updated (diff)
Actions #2

Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84217

Actions #3

Updated by Gerrit Code Review 6 months ago

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #4

Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #5

Updated by Gerrit Code Review 6 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #6

Updated by Georg Ringer 6 months ago

  • Related to Bug #91403: TYPO3 v9.5.17 and News v8.3.0 - 404 Error on detail pages from news-records, which are not translated to target language (Language Mode "Strict" or "Fallback) added
Actions #7

Updated by Gerrit Code Review 6 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #8

Updated by Gerrit Code Review 4 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #9

Updated by Gerrit Code Review 4 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #10

Updated by Gerrit Code Review 4 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #11

Updated by Gerrit Code Review 4 months ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #12

Updated by Gerrit Code Review 4 months ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #13

Updated by Gerrit Code Review 4 months ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #14

Updated by Gerrit Code Review 4 months ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions #15

Updated by Gerrit Code Review about 1 month ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84514

Actions

Also available in: Atom PDF