Bug #89271
openInline (IRRE) records are not kept in sync on record save
0%
Description
Setup description¶
Table "project"
- translatable
- IRRE field "assignments" (l10n_mode = exclude)
Table "assignment"
- not translatable
- boolean flag "checked" (default 0)
Reproduction¶
- Create a project record and add an assignment in default language => project uid = 1, assignment record uid = 23
- Create a translation of the project record => project uid = 2, assignment record uid = 24 (assignments duplicated for the translation, but have no connection to the parent's assignment 23)
- Edit the project again (uid 23) and change the "checked" field to "1" in the assignment
- Save the project
Expected behaviour¶
The assignment associated with the translated project has a value of "1" for the "checked" field.
(The change in the default language has to be mirrored to the translations due to l10n_mode = exclude)
Seen behaviour¶
The value of the "checked" field of the assignment of the translated project stays unchanged (=0)
Impact¶
The editor in the Backend changes information in an inline child and wonders why things are not updated in the Frontend for translations.
The workaround for the editor would be to open each and every translation of the parent (project) and save it once.
Analysis¶
The DataHandler runs a preprocessing of the datamap with the DataMapProcessor
.
In this step all inline children of the translations are purged and regenerated based on the default record's children.
In this phase though, the changed child (assignment) is not yet persisted. Hence, the new translation's children are generated based on old data.
We see two possible solutions:
- Merge the information of the updated assignment from the datamap with the values currently persisted in the database. (this might be very tricky)
- Defer the synchronization of the IRRE children of translations until the main datamap processing has been completed. (this is most like the way to go)