[BUGFIX] Fix Extbase language fallback in query parser 59/31859/4
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 27 Jul 2014 08:55:35 +0000 (10:55 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 27 Jul 2014 10:55:22 +0000 (12:55 +0200)
commit82c886a33a167d92cc8d6c0bc623d45369bf2ccd
tree2cf72d5abd58b6b39ae65f95605c362dbf55f39c
parent2fc3ec6b9c8550dc9cb606a74dcf52d8ae22b3d7
[BUGFIX] Fix Extbase language fallback in query parser

Currently when TYPO3 is configured to do language fallback
and a record is translated in language A, but not
in language B and language B is requested, then this
record is excluded.

This is the case because of a wrong subselect condition.

Extbase selects records in the requested translation
or if no translation is available in the default language.
However the check if translation is available looks
for *any* translation not only for a translation in the
requested language. Thus the record from the default
language is not selected at all if there are translations
available in any other language.

Solution is to change the subselect condition to check
for the currently requested language.

Releases: 6.1, 6.2, master
Resolves: #60613
Change-Id: I8ebd68e1f5741d3557910ae2f8c2d19474548d01
Reviewed-on: http://review.typo3.org/31859
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php
typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.xml [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbQueryParserTest.php