Bug #63694

extbase: strict mode and bug with queries in regards addSysLanguageStatement - e.g. contains ignores different MM translations

Added by Andreas Allacher about 4 years ago. Updated 2 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Extbase + l10n
Target version:
Start date:
2014-12-09
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If one uses addSysLanguageStatement with strict mode the generated statement is incorrect.
The reason is that if I use not strict, the translated record is selected if one exist.

If I use strict I only seem to select the translated record IF there is not parent record to it, otherwise I select the parent record If there is a corresponding translations.

This means that for instance if I use a query with "contains" that has different relations in the child record, it still uses the translations of the parent record.
This might also be the case for different translations.


Related issues

Related to TYPO3 Core - Bug #77298: Wrong language overlay logic in extbase Closed 2016-07-29

History

#1 Updated by Christian Kuhn about 4 years ago

Hey Andreas. SQL strict mode is currently not supported at all, enabling this (or not disabling on mysql with younger versions) fails at tons of places in the core afaik.

#2 Updated by Andreas Kiessling almost 4 years ago

I don't think Andreas is talking about SQL strict mode, but rather config.sys_language_mode.
Extbase and multilanguage is tricky since there are so many config options to consider. I always try to avoid having different relations in translated records. You might want to have a look at "$query->getQuerySettings()->setLanguageMode(..)" to change the language mode on specific queries

#3 Updated by Andreas Allacher almost 4 years ago

Yes. I mean config.sys_language_mode
And this ticket is actually for the new "LanguageMode" setting in extbase. If that is set to "strict".
There is the issue with how the records are retrieved.
I only retrieve the translated records if there is no parent record, otherwise extbase gets the parent record and translates that one.

Which, of course, kind of invalidates the usage of strict. After all this might "destroy" ordering and as mentioned it uses the translations in the MM table of the language parent.

Sorry for the delay. Forgot to mark the issue as "Watch" and therefore got no notification.

#4 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37039

#5 Updated by Gerrit Code Review almost 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37039

#6 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 http://review.typo3.org/37039

#7 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 http://review.typo3.org/37039

#8 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 http://review.typo3.org/37039

#9 Updated by Andreas Allacher over 3 years ago

This is for instance an issue if you have the following:

$records =  [
   [
      'uid' => 1,
      'title' => 'a',
      'sys_language_uid' => 0
   ],
   [
      'uid' => 2,
      'title' => 'b',
      'sys_language_uid' => 0
   ],
   [
      'uid' => 3,
      'title' => 'b',
      'sys_language_uid' => 1,
      'l10n_parent' => 1
   ],
   [
      'uid' => 4,
      'title' => 'a',
      'sys_language_uid' => 1.
      'l10n_parent' => 2
   ],
]

Now if I search for records in sys_language_uid = 1 and order by title, I will get
the records with UID 3 and then 4, whereas one would expect 4 and then 3.

#10 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 http://review.typo3.org/37039

#11 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 http://review.typo3.org/37039

#12 Updated by Gerrit Code Review almost 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/37039

#13 Updated by Tymoteusz Motylewski about 2 years ago

  • Category changed from Extbase to Linkvalidator
  • Target version set to 8 LTS

#14 Updated by Gerrit Code Review over 1 year 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/37039

#15 Updated by Benni Mack over 1 year ago

  • Target version changed from 8 LTS to next-patchlevel

#16 Updated by Tymoteusz Motylewski over 1 year ago

  • Category changed from Linkvalidator to Extbase + l10n

#17 Updated by Markus Klein 10 months ago

  • Related to Bug #77298: Wrong language overlay logic in extbase added

#18 Updated by Tymoteusz Motylewski 2 months ago

Hi,
Please take a look at this patch https://review.typo3.org/#/c/53974/
It should contain tests (and fixes) covering your issue.

Also available in: Atom PDF