Review main Abandoned

63622[BUGFIX] Sync "connected" translation position when moving original

Claus Due CR 0 V 0 Easy +9 −0 updated 11/11/26, 11:26

Commit message

As described in linked issue, when an original version of a
record that has a "connected" translation is moved around
in page columns or sorting order, the translated versions
of the original record are not:

* Updated with colPos value if dropped in top of a column
* Updated with sorting value if dropped in top of a column

The problem is tracked down to the DataMapProcessor
which attempts to perform field value synchronisation but
ends up processing an incorrect composition of fields which
does not include the "colPos" and "sorting" values of the
original record as "suggested field values" for the localized
version of the record.

The result is that DataMapProcessor creates an incomplete
data map for a nested DataHandler instance which does the
actual processing of the translated record's values through
processing of a data map.

This behavior can be corrected by disallowing localized values
in "connected" mode for the two fields colPos and sorting.
When setting "l10n_mode" to "exclude" for these fields, the
values are correctly synchronised from the original language
version when dropping the original record in the top of a page
column. In order to facilitate this, it is necessary to declare the
"sorting" field as a TCA field of type "none", without adding it
to any palettes or other configuration that would cause the
field to be shown in an editing form.

End result is:

* tt_content.colPos is strictly copied from original in all "connected"
  translations of the record, fixing the issue that moving the
  original record to a different column in top position does not
  equally move the translated versions of that record to the new
  page column (colPos not updated).
* tt_content.sorting is also strictly copied from original when moving
  the original record to the top of a column, whether it is a different
  column or the same column.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 1922

  1. Claus Due uploaded patch set 1 03/08/20, 16:44

  2. TYPO3com voted on patch set 1 V -1 03/08/20, 16:55 Completed build in 10m 39s on Sun, 8 Mar, 04:55 PM Test Summary: 71496 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1134

  3. TYPO3com voted on patch set 1 V +1 03/08/20, 17:11 Completed build in 11m 21s on Sun, 8 Mar, 05:11 PM Test Summary: 72099 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1136

  4. Claus Due commented on patch set 1 03/11/20, 09:23

    @Olli would you mind taking a look at this and if necessary, relating it to other issues that I am unaware of, which would also be solved by this (e.g. the sorting things we discussed in the core mergers meeting)?
  5. Oliver Hader commented on patch set 1 03/12/20, 14:37

    It think it's related to `copyAfterDuplFields` as well (or should be tackled in a combined approach). Without actually having functional tests that explicitly check the behavior of free vs. connected mode records, it's difficult to ensure the correct behavior. Aspects for tests would be * at least three records * each of them being localized (all as free and again all as connected) * having multiple levels of language localizations (l10n_source) (default -> langage 1, default -> language 1 -> language 2) * having versions (live vs draft workspace) And once this scenario is ready the following actions/commands should be applied: * insert record a top, create corresponding localizations (see above) * insert record after existing record, create corresponding localizations (see above) * move record a top * move record after existing record

    tt_content.php:454

    This would lead to scenarios where user probably cannot change sorting anymore in case they don't have permission to this field. We have similar issues already mit l10n_parent et al which actually should be "system internal values" and require a different permission handling & concept...

    tt_content.php:455

    This would actually trigger DataMapProcessor to take care of the synchronization records that have a relationship between each other in the language axis. For records having a l10n_source field it probably might have side effects. In "free mode" l10n_parent empty, but l10n_source is set (if defined in TCA for that table), which would lead to an implicit "connected mode" even if defined as "free mode"... In general, "free mode" and "connected mode" is currently just an interpretation. It was never clearly introduce as concept to our "models" - it actually just lives in the page module and the localization wizards there - but that's a different story...
  6. Oliver Hader voted on patch set 1 CR -1 03/12/20, 14:37

  7. Claus Due commented on patch set 1 03/12/20, 15:07

    Thanks for the input Olly. Main question for me now is, will we prevent this from being fixed until we have a complete set of functional tests ready for that? If that's the case I wouldn't be able to assist further since I have no idea how to even begin making a functional test setup for something like this. AFAICS there are no current functional tests for data handling with some very edge case exceptions (which I'm unable to convert to more generic cases and further extend to establish tests for other data handling, e.g. sorting or moving).

    tt_content.php:454 Reply Unresolved

    I half considered not doing it this way and instead making a (hardcoded) list of "system fields" that would always be in sync with an original. Perhaps that's a better way?

    tt_content.php:455 Reply Unresolved

    Correct me if I'm wrong but DataMapProcessor seems to disregard records that have l10n_source but don't have l18n_parent (e.g. are in "free" mode)? I agree it mostly exists in the page layout view but it seems to be at least partially implemented as shared logic elsewhere as well...
  8. TYPO3com voted on patch set 1 V -1 03/24/20, 13:55 Completed build in 11m 56s on Tue, 24 Mar, 01:55 PM Test Summary: 19 of 73501 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1669

  9. Benni Mack commented on patch set 1 10/08/21, 08:07

    Both contributors, can you either proceed or abandon this change? This has been a dead-lock-situation for about 1.5 years now
  10. Oliver Hader commented on patch set 1 CR 0 10/11/21, 13:07

    Removing my -1 since I don't have a better idea right now & leave it to Claus how to proceed.
  11. Oliver Hader wrote 10/11/21, 13:07

    Removed reviewer Oliver Hader.
  12. Benni Mack wrote 11/29/21, 10:12

    Change destination moved from master to main
  13. Benni Mack updated the commit message in patch set 2 11/29/21, 13:35

  14. Benni Mack updated the commit message in patch set 3 05/03/23, 09:03

  15. Stefan Bürk commented on patch set 3 09/27/23, 15:21

    Reply

    Bennis question is 2 years old. Any ongoing here ? Otherwise, I guess we could abandon this in the next time. Oliver ? Claus ?
  16. Claus Due commented on patch set 3 09/28/23, 08:33

    Reply

    AFAIK this bug is still happening. I do not think it is (and was) reasonable to block this from being merged or even processed further by demanding that a completely new functional test case must be written to cover the entire functionality around moving a content record which has a translation. Oliver's comments and my followup questions for them remain un-addressed. I cannot address these single-handedly and I have provided my input - now someone from the core team should provide guidance as to what would be an acceptable solution (if this currently proposed solution is not acceptable). To recap: as an alternative to adding TCA for the field, given that Oliver has concerns this may influence editors without access to the field, I suggested not modifying TCA and instead creating a (hardcoded/configurable) list of system fields that should be kept in sync between original and translated versions when in connected mode. I would still appreciate if this got fixed.
  17. Benni Mack commented on patch set 3 09/10/24, 20:27

    in case someone is still looking for this change: - colPos will become hidden in translations see https://review.typo3.org/c/Packages/TYPO3.CMS/+/85978 sorting still needs a sorting -> also with an upgrade wizard along with a lot of tests.
  18. Claus Due commented on patch set 3 09/11/24, 13:07

    Unresolved

    It appears https://review.typo3.org/c/Packages/TYPO3.CMS/+/85978 will not be backported to v12 (Releases: main), which means the issue still exists in v12 and IMHO still requires a solution on that version.
  19. Benni Mack updated the commit message in patch set 4 10/18/24, 13:49

  20. Benni Mack wrote 04/21/26, 14:55

    Removed cc Benni Mack.
  21. Benni Mack marked it work in progress 04/21/26, 14:55

  22. Benni Mack abandoned the change 11/11/26, 11:26

    abandoning this change - as stated in the issue, the case does not happen anymore, and I now added tests here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/97536