Review main Merged

82996[BUGFIX] Honor workspace l10n_parent can point to live

Christian Kuhn CR +2 V +2 Expert +2318 −25 updated 02/29/24, 17:31

Commit message

When a record localization is changed in workspaces,
`transOrigPointerField` ("l10n_parent") can point to
either the default language -live-, OR default language
-workspace- record, depending on workspace action chains
as detailed below.

FormEngine did not deal with that properly when
`showPossibleLocalizationRecords` for inline (or file)
children is enabled, and did tend to show a possible
localization child even though a record has been localized
already ("shown twice"). This issue exists for a long
time already, but became more obvious with #94623, which
enabled `showPossibleLocalizationRecords` for tt_content
image.

The main fix of the patch is to make FormEngine aware
of this scenario and suppress listing a localized
workspace record as "can be synchronized" when its
l10n_parent field points to live.

As drive-by, the patch fixes a missing reference index update
call in DH when "synchronizing" a relation in workspaces.

The patch also adds some `@todo`s to point out situations
where the "parent count" fields are incorrect.

The added tests show scenarios where a localized workspace
record points to either its live, or its workspace default
language "parent" in the "l10n_parent" field. We're adding
the tests for FAL, but the situation is similar with parent
(here: tt_content), with inline csv and inline foreign field:

a) modifyContentLocalizeAddDefaultLangRelationSynchronize()
   Having a content element and a localization in live. Add an
   image in workspace default language and synchronize into
   workspace localized record: l10n_parent of new localized
   sys_file_reference points to the workspace sys_file_reference
   record. This is quite obvious, since there is no live record
   to point to.

b) localizeLiveModifyWsLocalizationAddLiveWsSync()
   Having a content element and a localization in live. Modify
   the localization in workspaces, by for instance changing the
   title of the content element. This creates a workspace
   overlay of that localized element in workspaces. Then add
   an image to the default language live content element, and
   synchronize this in the localized workspace element. Now,
   l10n_parent of the new localized sys_file_reference points
   to the live sys_file_reference record. This is because an
   overlay of the default language record does not exist.

c) localizeLiveModifyWsDefaultLang()
   Having a content element with image and a localization in
   live. Modify the default content element in workspaces, by
   for instance changing the title of the content element. This
   creates workspace overlays of the default language record,
   *and* overlays of the localized content elements. It also
   creates overlays of the attached images in both the default
   language record and its localizations. l10n_parent of the
   sys_file_reference localized records now point to the live
   version. This scenario is debatable since overlays of the
   default language record exist. We decided to keep this
   behavior, since we'd otherwise have to deal with
   updating these pointers when publishing localizations.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 3

Files 36

Show 16 more files

Review log 1526

Show 1 earlier messages
  1. Christian Kuhn uploaded patch set 1 02/14/24, 12:54

  1. core-ci voted on patch set 1 V +1 02/14/24, 12:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53193

  2. Christian Kuhn uploaded patch set 2 V +1 02/29/24, 06:47

  3. core-ci voted on patch set 2 V +1 02/29/24, 06:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53700

  4. Christian Kuhn uploaded patch set 3 V +1 02/29/24, 08:14

  5. core-ci voted on patch set 3 V +1 02/29/24, 08:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53702

  6. Christian Kuhn uploaded patch set 4 V +1 02/29/24, 08:50

  7. core-ci voted on patch set 4 V +1 02/29/24, 08:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53706

  8. Christian Kuhn uploaded patch set 5 V +1 02/29/24, 09:04

  9. core-ci voted on patch set 5 V +1 02/29/24, 09:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53707

  10. Christian Kuhn uploaded patch set 6 V +1 02/29/24, 10:24

  11. core-ci voted on patch set 6 V +1 02/29/24, 10:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53710

  12. Christian Kuhn uploaded patch set 7 V +1 02/29/24, 10:51

  13. Christian Kuhn uploaded patch set 8 02/29/24, 10:57

  14. core-ci voted on patch set 7 V +1 02/29/24, 10:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53711

  15. core-ci voted on patch set 8 V +1 02/29/24, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53714

  16. Christian Kuhn uploaded patch set 9 V +1 02/29/24, 12:22

  17. core-ci voted on patch set 9 V +1 02/29/24, 12:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53721

  18. Christian Kuhn updated the commit message in patch set 10 V +1 02/29/24, 13:30

  19. Christian Kuhn updated the commit message in patch set 11 02/29/24, 13:31

  20. core-ci voted on patch set 10 V +1 02/29/24, 13:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53723

  21. core-ci voted on patch set 11 V +1 02/29/24, 13:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53724

  22. Benni Mack voted on patch set 11 CR +1 V +1 02/29/24, 13:56

  23. Anja Leichsenring voted on patch set 11 CR +1 V +1 02/29/24, 17:03

  24. Christian Kuhn voted on patch set 11 CR +2 V +2 02/29/24, 17:31

  25. Christian Kuhn merged patch set 12 02/29/24, 17:31