Bug #103658
openLanguageMenuProcessor / (Routing) creates invalid links if a record is not translated
0%
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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