Project

General

Profile

Actions

Bug #87093

closed

TYPO3 9.5: CONTENT TypoScript object type does not select records with language set to -1

Added by Manfred Egger almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2018-12-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If you create tt_contents with language set to "All" aka 1 then those records are only shown in foreign languages. In the default language (sys_language_uid = 0) they are not shown.
It seems that in ContentObjectRenderer->getQueryConstraints the constraint "AND (tt_content.sys_language_uid in (0,-1))" is only added, if the same page is opened in other languages. In the default language it's always "AND (tt_content.sys_language_uid = 0)". In TYPO3 8.5 the expected constraint is also added in the default language.
The problem is, that in ContentObjectRenderer
>getQueryConstraints the LanguageAspect's doOverlays() method is queried, and this only return true if sys_language_uid is greater 0.
For me the solution is to change the else part on line 6936 (TYPO3 9.5.1) in ContentObjectRenderer.php from

$languageQuery = $expressionBuilder->eq($languageField, $languageAspect->getContentId());

to

$languageQuery = $expressionBuilder->in($languageField, [$languageAspect->getContentId(), -1]);

but I don't know if there are any unexpected side effects.

Side note: I also made some other tests and for me extbase records and even the RECORD TypoScript object works as expected. I think only CONTENT TypoScript object and code parts which depends on ContentObjectRenderer->getQueryConstraints are affected.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #87950: No language fallbackClosed2019-03-19

Actions
Has duplicate TYPO3 Core - Bug #87749: content elements with language "all languages -1" not working in default languageClosed2019-02-20

Actions
Actions

Also available in: Atom PDF