Bug #89131
openRecords that are only available in specific language (no default parent) are not considered using consistentTranslationOverlayHandling
0%
Description
There's no differentiation between LanguageAspect::OVERLAYS_ON and LanguageAspect::OVERLAYS_ON_WITH_FLOATING in Extbase. 'hideNonTranslated' corresponds to both (see LanguageAspect::getLegacyOverlayType()).
Therefore, I think records that are only available in a specific language should also be considered (as it says for LanguageAspect::OVERLAYS_ON_WITH_FLOATING).
But I'm not sure if it should be done only for language mode "hideNonTranslated" or also for language mode true (LanguageAspect::OVERLAYS_MIXED).
Suggestion:¶
If it can be done for language mode true and hideNonTranslated:
sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php 925 925 // translated records where a default translation exists 926 926 $andConditions[] = $this->queryBuilder->expr()->andX( 927 927 $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, (int)$querySettings->getLanguageUid()), 928 - $this->queryBuilder->expr()->in( 929 - $tableAlias . '.' . $transOrigPointerField, 930 - $defaultLanguageRecordsSubSelect->getSQL() 928 + $this->queryBuilder->expr()->orX( 929 + $this->queryBuilder->expr()->in($tableAlias . '.' . $transOrigPointerField, 0), 930 + $this->queryBuilder->expr()->in( 931 + $tableAlias . '.' . $transOrigPointerField, 932 + $defaultLanguageRecordsSubSelect->getSQL() 933 + ) 931 934 ) 932 935 ); 933 936 if ($mode !== 'hideNonTranslated') {
If it should be done only for language mode hideNonTranslated:
sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php 918 $defaultLanguageRecordsSubSelect->expr()->eq($defLangTableAlias . '.' . $languageField, 0) 919 ) 920 ); 921 + $transOrigPointerCondition = $this->queryBuilder->expr()->in( 922 + $tableAlias . '.' . $transOrigPointerField, 923 + $defaultLanguageRecordsSubSelect->getSQL() 924 + ); 925 + if ($mode === 'hideNonTranslated') { 926 + $transOrigPointerCondition = $this->queryBuilder->expr()->orX( 927 + $this->queryBuilder->expr()->in($tableAlias . '.' . $transOrigPointerField, 0), 928 + $transOrigPointerCondition 929 + ); 930 + } 921 931 922 932 $andConditions = []; 923 933 // records in language 'all' 924 934 $andConditions[] = $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, -1); 925 935 // translated records where a default translation exists 926 936 $andConditions[] = $this->queryBuilder->expr()->andX( 927 937 $this->queryBuilder->expr()->eq($tableAlias . '.' . $languageField, (int)$querySettings->getLanguageUid()), 928 - $this->queryBuilder->expr()->in( 929 - $tableAlias . '.' . $transOrigPointerField, 930 - $defaultLanguageRecordsSubSelect->getSQL() 931 - ) 938 + $transOrigPointerCondition 932 939 ); 933 940 if ($mode !== 'hideNonTranslated') {
Example to illustrate the problem:¶
A German news with e.g. sys_language_uid 1 and without parent record (German only) is currently not output on the German page with consistentTranslationOverlayHandling and fallbackType: strict. With the above fix it will be included.
Updated by Mathias Brodala almost 4 years ago
- Related to Bug #88886: DataMapper: Consider languageOverlayMode "hideNonTranslated" when getting relations using consistentTranslationOverlayHandling added
Updated by Henrik Elsner over 2 years ago
- Related to Bug #97587: CEs with no default are thrown away - hideNonTranslated ignored added
Updated by Tymoteusz Motylewski 2 months ago
- Assignee deleted (
Tymoteusz Motylewski)