Feature #88137
closedCreate multi-step fallback for content and arbitrary records
100%
Description
It should be possible to show content of language=2, and if it is not translated, use the fallback chain to language=1 and stop there.
Updated by Benni Mack over 5 years ago
- Related to Bug #86762: Site-Configuration defined language fallbacks not working added
Updated by Benni Mack over 5 years ago
Also see Daniel's comment / code snippet in the other issue
Updated by David Bruchmann over 5 years ago
Hi Benni,
just pulled news master-dev and tested a bit.
Good news is that without RouteEnhancer everything is working fine, also if I use only the uid in RouteEnhancer.
Fine is related to my (known) personal scenario:
language 0 no fallback
language 1 no fallback
language 2 fallback to language 1
In languages 0 and 1 the slugs are created correct if I use news_title in RouteEnhancer - that's working well.
In language 2 the titles are not produced (by extension seo?) but instead the uids are appended to the configured path, but this is not resolved by EXT:news and results in a 404 error.
So the URLs look like this: https://domain.com/a-lactu/article/255
So my issue is about the RouteEnhancer and the language-fallback of the titles of the news.
Now I don't know if the RouteEnhancer just has to be configured different or if some extensions like seo, backend, frontend, etc. have to be changed (or even something in news).
Here still my desired setup for the news-titles (categories, etc. I leave away here):
routeEnhancers: News: type: Extbase extension: News plugin: Pi1 routes: - routePath: '/{news_title}' _controller: 'News::detail' _arguments: news_title: news defaultController: 'News::list' requirements: news_title: '^[a-zA-Z0-9].*$' page: \d+ aspects: news_title: type: PersistedAliasMapper tableName: tx_news_domain_model_news routeFieldName: path_segment
and here the working setup with uids only:
routeEnhancers: News: type: Extbase extension: News plugin: Pi1 routes: - routePath: '/{news_uid}' _controller: 'News::detail' _arguments: news_uid: news defaultController: 'News::list' aspects: news_uid: type: PersistedAliasMapper tableName: tx_news_domain_model_news routeFieldName: uid
Updated by David Hedden over 3 years ago
For folks that find this and want to impelement a solution for Typo3 9.5.
Typo3DbQueryParser and PageRepository via XCLASS, fallback can be enabled by settings languageAspect to true for a table.
This solution works for 1 level Typo3DbQueryParser.php
This works for multiple levels Typo3DbQueryParser.php
But its with a raw statments. Should be a bit faster, since overlaying happens in 1 Statement. Based on solution from David BruchmannDifference is that rows get discarded if default (0) is not defined in fallback chain.
Updated by Gerrit Code Review over 3 years ago
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67894
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67895
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67895
Updated by Gerrit Code Review over 3 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67895
Updated by Gerrit Code Review over 3 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67895
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67957
Updated by Gerrit Code Review over 3 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67895
Updated by Gerrit Code Review over 3 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67895
Updated by Gerrit Code Review over 3 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 3 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Simon Praetorius about 3 years ago
We recently experienced this bug in a client project and developed a temporary workaround that works in our case. Maybe this is helpful for somebody:
config.yaml:
aspects: news-title: type: LanguageFallbackPersistedAliasMapper tableName: tx_news_domain_model_news routeFieldName: path_segment
ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects']['LanguageFallbackPersistedAliasMapper'] = \Sitegeist\Sitepackage\Routing\Aspect\LanguageFallbackPersistedAliasMapper::class;
LanguageFallbackPersistedAliasMapper.php:
[...] class LanguageFallbackPersistedAliasMapper extends PersistedAliasMapper { /** * @param array|null $record * @return array|null */ protected function resolveOverlay(?array $record): ?array { $result = parent::resolveOverlay($record); $languageAware = $this->languageFieldName !== null && $this->languageParentFieldName !== null; if (!$languageAware) { return $result; } $languageFallbackChain = array_reverse($this->resolveAllRelevantLanguageIds()); $pageRepository = $this->createPageRepository(); if (!$result || $result[$this->languageFieldName] == 0 && $languageFallbackChain) { foreach ($languageFallbackChain as $fallbackLanguageId) { $result = $pageRepository ->getRecordOverlay($this->tableName, $record, $fallbackLanguageId) ?: null; if ($result[$this->languageFieldName] == $fallbackLanguageId) { break; } } } return $result; } }
Note that this will lead to more SQL queries during link generation, but in our case the correct links were more important.
Updated by Gerrit Code Review about 3 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review almost 3 years ago
Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67893
Updated by Gerrit Code Review over 2 years ago
Patch set 25 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/+/67893
Updated by Gerrit Code Review over 2 years ago
Patch set 26 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/+/67893
Updated by Gerrit Code Review over 2 years ago
Patch set 27 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/+/67893
Updated by Gerrit Code Review over 2 years ago
Patch set 28 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/+/67893
Updated by Gerrit Code Review about 2 years ago
Patch set 29 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/+/67893
Updated by Gerrit Code Review about 2 years ago
Patch set 30 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/+/67893
Updated by Gerrit Code Review almost 2 years ago
Patch set 31 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/+/67893
Updated by Gerrit Code Review almost 2 years ago
Patch set 32 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/+/67893
Updated by Oliver Hader almost 2 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Gerrit Code Review over 1 year ago
Patch set 33 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/+/67893
Updated by Gerrit Code Review over 1 year ago
Patch set 34 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/+/67893
Updated by Gerrit Code Review over 1 year ago
Patch set 35 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/+/67893
Updated by Gerrit Code Review over 1 year ago
Patch set 36 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/+/67893
Updated by Gerrit Code Review over 1 year ago
Patch set 37 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/+/67893
Updated by Gerrit Code Review over 1 year ago
Patch set 38 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/+/67893
Updated by Gerrit Code Review over 1 year ago
Patch set 39 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/+/67893
Updated by Gerrit Code Review over 1 year ago
Patch set 40 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/+/67893
Updated by Anonymous over 1 year ago
- Status changed from Under Review to Resolved
Applied in changeset b00bc4bd822adb037c6a57726d96acd99153bab8.
Updated by Benni Mack 6 months ago
- Related to Bug #91781: Language Fallback Chain is not working in custom Extension added