[BUGFIX] Add table name as prefix for language DB selection 30/60430/2
authorBenni Mack <benni@typo3.org>
Tue, 9 Apr 2019 12:42:02 +0000 (14:42 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 10 Apr 2019 19:04:01 +0000 (21:04 +0200)
When building JOINs with TypoScript of tt_content or
any localized table, using "LEFTJOIN tt_content table2"
the language restriction check is not using a prefix
for the "l10n_parent" field.

The "sys_language_uid" field already has the same prefix
built in the same method.

This error existed in v8 already, but in TYPO3 v9, the
"includeRecordsWithoutDefaultTranslation" option is enabled
by default (via LanguageAspect), therefore it's more
prominent.

Resolves: #87521
Releases: master, 9.5
Change-Id: I1a3ee4f1f84d64a5d56cf63607a7aed83fdd13fc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60430
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Jörg Bösche <typo3@joergboesche.de>
Tested-by: Julian Geils <j_geils@web.de>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Julian Geils <j_geils@web.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index d855a52..0810e6e 100644 (file)
@@ -6586,7 +6586,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
                 $languageQuery = $expressionBuilder->orX(
                     $languageQuery,
                     $expressionBuilder->andX(
-                        $expressionBuilder->eq($localizationParentField, 0),
+                        $expressionBuilder->eq($table . '.' . $localizationParentField, 0),
                         $expressionBuilder->eq($languageField, $languageAspect->getContentId())
                     )
                 );