Bug #102336
openAdd support for localizing n:1 relations
0%
Description
When localizing a parent-child relationship (IRRE) from the parent side, DataHandler correctly creates the localized children and also sets their "parent" relation (n:1) field to the localized parent.
But when localizing a parent-child relationship from the other (child) side (or localizing any record containing n:1 relations in general), DataHandler does not set these (n:1) relations to point to the localized record (instead, they point to the L=0 record). This is not a consistent behavior and at least breaks extbase, too.
The current behaviour is also problematic in the following use case: When having a parent-child relationship with 100 parents each owning 100 children. In addition to the "parent" (n:1) relation, these children also contain any other n:1 relations to different models. Now after localizing a "parent", for each "children" these additional n:1 relations must be modified manually by an editor to point to the localized record (which is impossible when dealing with larger datasets).
My suggestion is, when localizing a record containing any n:1 relation, DataHandler should behave like this:
- Lookup if there is any localized version of this (n:1) relation target
- If there is, set the relation to the localized records uid
- If there isn't, set the relation to the original records uid (as a fallback)