Project

General

Profile

Actions

Bug #90430

open

Language handling of bidirectional mm selects is not consitent.

Added by Eike Starkmann about 4 years ago. Updated 26 days ago.

Status:
Under Review
Priority:
Must have
Category:
Extbase + l10n
Target version:
-
Start date:
2020-02-19
Due date:
% Done:

0%

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

Description

I found a inconsistent behaviour in the new language handling of typo3 9.5. The situation is like this, I have a bidirectional mm relation with selects on both sides, which are excluded in non default languages. I adapted it to the blog example.
So lets say we have posts and tags which can be selected on both sides.

I reproduced this behaviour in blog_example:
https://github.com/undkonsorten/blog_example/commit/4bcdae43cf750c98f6f39fc4864430d202bf2891

Scenario:

I create a blog post (P) with uid 1
I create a tag (T) with uid 11
I create a translation P' for P with uid 2
I create a translation T' for T with uid 12

I open P (default language) and add T.

Database looks like this:

uid_local    uid_foreign
1            11
2            11

P <=> T
P' <=> T

I open T (default language) and save it.

Database looks like this:

uid_local    uid_foreign
1            11
1            12

P <=> T
P <=> T'

Save P' or T':
uid_local    uid_foreign
1            11
1            12
2            12
2            11

P <=> T
P <=> T'
P' <=> T
P' <=> T'

The problem is that when I save T the tag is no longer shown on that post in Frontend.

The modified extension can be found here:
https://github.com/undkonsorten/blog_example/


Related issues 4 (4 open0 closed)

Related to TYPO3 Core - Bug #84682: TYPO3 8 Relationship Localization BugNew2018-04-10

Actions
Related to TYPO3 Core - Bug #65859: Support l10n_mode in extbaseUnder Review2015-03-20

Actions
Related to TYPO3 Core - Bug #92777: TCA l10n_mode exclude and MM relationsUnder Review2020-11-05

Actions
Related to TYPO3 Core - Bug #102336: Add support for localizing n:1 relationsNew2023-11-07

Actions
Actions #1

Updated by Oliver Hader about 4 years ago

  • Status changed from New to Needs Feedback

Thanks for your report, I've got a couple of questions - please see below

Eike Starkmann wrote:

I found a inconsistent behaviour in the new language handling of typo3 9.5.

Are you referring to changes for l10n_mode in TYPO3 v8 in the backend (DataHandler et al) or the introduced site language handling in TYPO3 v9?

I open P (default language) and add T.

How are entities/records modifies? Does that happen only in Extbase or can it be reproduced in the TYPO3 backend as well?

Actions #2

Updated by Eike Starkmann about 4 years ago

Oliver Hader wrote:

Thanks for your report, I've got a couple of questions - please see below

Eike Starkmann wrote:

I found a inconsistent behaviour in the new language handling of typo3 9.5.

Are you referring to changes for l10n_mode in TYPO3 v8 in the backend (DataHandler et al) or the introduced site language handling in TYPO3 v9?

I'm refering the new language handling introduced in TYPO3 v9.

I open P (default language) and add T.

How are entities/records modifies? Does that happen only in Extbase or can it be reproduced in the TYPO3 backend as well?

They are modified in backend.

Actions #3

Updated by Eike Starkmann almost 4 years ago

I think this might be related to #90925

I will test soon if this problem still exists in 9.5.16

Actions #4

Updated by Stefan P almost 4 years ago

  • Priority changed from Should have to Must have

I can confirm this (or some related) behaviour. I have this situation:

I have a tree. Each record has a renderType tree field where its parent is stored. The L=1 records store there the uid of the translated(!) parent. This is done by DataHandler itself (I import the records into the database by using DataHandler and also use the DataHandler to localize them).

The parent/tree field is l10n_mode => exlcude!

What happens then:

In Extbase and L=1 I say $parent->getChildren() -> I get all localized children. Perfect.

I then go into backend, and simply save one of the L=1 child records (no changes!). Backend shows everything fine, before and after. Seems perfect (but isn't).

Then: I say in Extbase and L=1 $parent->getChildren() -> the just saved record is MISSING!

What did change? The save in the backend changed the stored parent uid from the L=1 uid to the L=0 uid.

So, either DataHandler or Extbase have a bug here. Interesting to know would be why the Datahandler behaves differently when called from a click in BE or when called in a Command (import). Seems some l10n config is treated differently here.

Actions #5

Updated by Stefan P almost 4 years ago

If I remove l10n_mode => exclude it works suddenly. The backend then does not change the refenrecned uid upon saving (it stays the one of the L=1 parent) and Extbase still displays it in the frontend.

Actions #6

Updated by Karsten Nowak (undkonsorten) over 3 years ago

Problem still exists in 9.5.20.

Today I tried to remove the l10n_mode setting. If I limit the selectable data to the current sys_language_uid of the record and set every relation in the translated records too, then the output in frontend is really correctly. But, I don't want editing every record twice if I add a new relation. Even more there are 3 or 4 relations to be add.

That can't be the solution.

I expect the output should be work also with l10n_mode exclude. And it does, but only when I save the data on the local side. If I save from the foreign side, then it's broken. Output in frontend is:

  • On default language page: the translated data of the relation (e.g. the title in english not german)
  • On translated page: no relations found.

I set up an ddev environment for local development for reproducing and analyzing the issue. There are a small extension with some simple models and relations between it. That makes it handy to understand the problem.

https://github.com/undkonsorten/dummymgmt-dev

Follow the Readme to setup the project. For questions I suggest slack. Write question to @karsten_uk

Here was the related Thread in Slack channel: https://typo3.slack.com/archives/C025BQLFA/p1598964529303700?thread_ts=1581514117.306000&cid=C025BQLFA

Actions #7

Updated by Jan Kornblum over 3 years ago

I had a similar issue with bidirectional relations (1:n <-> n:1). Tried to figure out what the currently expected behaviour is for handling relations in extbase as well as in backend. Finally, i've found...

https://review.typo3.org/c/Packages/TYPO3.CMS/+/43147/
"The backend expects the localized uid as parent id but extbase currently saves the original uid"

https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/9-CrosscuttingConcerns/1-localizing-and-internationalizing-an-extension.html#typo3-v9-and-higher

For me it seems to:

- The backend still (10 LTS) expects the relation field to point to the translated record (because when pointing to the L=0 record, i've got inconsistences at least in backend IRRE view and localization wizard)
- l10n_mode=exclude for relation fields is currently not supported for backend
- l10n_mode=exclude for relation fields is currently not supported for extbase

Am i right?

Actions #8

Updated by Wolfgang Klinger over 3 years ago

ping ping still a major problem
I don't feel able to solve this with this code base (DataHandler, Extbase), so no patch from me!

Actions #9

Updated by Gerrit Code Review over 3 years ago

  • Status changed from Needs Feedback 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 https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #10

Updated by Gerrit Code Review over 3 years ago

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

Actions #11

Updated by Jan Kornblum almost 3 years ago

  • Related to Bug #84682: TYPO3 8 Relationship Localization Bug added
Actions #12

Updated by Michael Rainer almost 3 years ago

Is there any news?
The patch file is still under review, isn't it?

Actions #13

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #14

Updated by Jan Kornblum over 2 years ago

This issue schould be extended to "language handling in relations is not constistent" in general. For example, (bidirektional) inline relations (1:n inline <-> n:1 select) should be evaluated, too. Lets have "seminar" and "event" (seminar.events = 1:n inline, event.seminar = n:1 select). I've spent the whole day trying to get any TCA configuration where both relations are set to "l10n_mode=exclude", without success. I think the "relation + translation" handling should be checked completely, also in conjunction with extbase.

Actions #15

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #16

Updated by Jan Kornblum over 2 years ago

  • Related to Bug #65859: Support l10n_mode in extbase added
Actions #17

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #18

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #19

Updated by Maik Kempe almost 2 years ago

  • Related to Bug #92777: TCA l10n_mode exclude and MM relations added
Actions #20

Updated by Gerrit Code Review 12 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #21

Updated by Gerrit Code Review 10 months ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #22

Updated by Gerrit Code Review 10 months ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #23

Updated by Jan Kornblum 5 months ago

  • Related to Bug #102336: Add support for localizing n:1 relations added
Actions #24

Updated by Gerrit Code Review about 1 month ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #25

Updated by Gerrit Code Review about 1 month ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #26

Updated by Gerrit Code Review about 1 month ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #27

Updated by Gerrit Code Review about 1 month ago

Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #28

Updated by Gerrit Code Review about 1 month ago

Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #29

Updated by Gerrit Code Review about 1 month ago

Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #30

Updated by Gerrit Code Review about 1 month ago

Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #31

Updated by Gerrit Code Review about 1 month ago

Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #32

Updated by Gerrit Code Review about 1 month ago

Patch set 18 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #33

Updated by Gerrit Code Review about 1 month ago

Patch set 19 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #34

Updated by Gerrit Code Review about 1 month ago

Patch set 20 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #35

Updated by Gerrit Code Review about 1 month ago

Patch set 21 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #36

Updated by Gerrit Code Review 26 days ago

Patch set 22 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #37

Updated by Gerrit Code Review 26 days ago

Patch set 23 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #38

Updated by Gerrit Code Review 26 days ago

Patch set 24 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions #39

Updated by Gerrit Code Review 26 days ago

Patch set 25 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67172

Actions

Also available in: Atom PDF