Review main Merged

85978[TASK] Disable custom colPos and CType for translations

Jochen Roth CR +2 V +2 Normal +213 −1 updated 09/11/24, 10:24

Commit message

Previously, it was possible to allow editors to modify
colPos and CType in FormEngine via connected CEs.

This has been changed when editing translated CEs, that
CType and colPos cannot be changed anymore.
An upgrade wizard is added to ensure that all translated
CEs really contain the same colPos and CType values as
their default language pendants.

Both fields are now set to l10n_mode=exclude to avoid
future inconsistencies.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • André Buchmann +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • André Buchmann +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 3552

Show 1627 earlier messages
  1. Jochen Roth uploaded patch set 1 09/10/24, 10:04

  2. Benni Mack updated the commit message in patch set 2 09/10/24, 10:12

  3. Jochen Roth uploaded patch set 3 09/10/24, 10:14

  4. Benni Mack updated the commit message in patch set 4 09/10/24, 10:15

  5. core-ci voted on patch set 1 V -1 09/10/24, 10:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65207

  6. core-ci voted on patch set 2 V -1 09/10/24, 10:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65210

  7. core-ci voted on patch set 3 V -1 09/10/24, 10:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65211

  8. core-ci voted on patch set 4 V -1 09/10/24, 10:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65213

  9. Jochen Roth uploaded patch set 5 V -1 09/10/24, 10:38

  10. core-ci voted on patch set 5 V -1 09/10/24, 10:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65216

  11. Benni Mack updated the commit message in patch set 6 V -1 09/10/24, 11:09

  12. core-ci voted on patch set 6 V -1 09/10/24, 11:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65217

  13. core-ci commented on patch set 6 09/10/24, 11:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65217

  14. Jochen Roth uploaded patch set 7 V -1 09/10/24, 12:51

  15. core-ci voted on patch set 7 V -1 09/10/24, 13:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65243

  16. Jochen Roth uploaded patch set 8 V -1 09/10/24, 13:27

  17. core-ci voted on patch set 8 V +1 09/10/24, 13:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65252

  18. Jochen Roth uploaded patch set 9 V +1 09/10/24, 15:09

  19. core-ci voted on patch set 9 V +1 09/10/24, 15:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65269

  20. Benni Mack commented on patch set 9 09/10/24, 15:22

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:60

    cast to (int)

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:65

    we could use a createNamedParameter()?
  21. Oli Bartsch commented on patch set 9 09/10/24, 15:29

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:98

    Might return false
  22. Oli Bartsch uploaded patch set 10 V +1 09/10/24, 15:50

  23. Oli Bartsch commented on patch set 10 09/10/24, 15:55

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:60 Reply

    Done

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:65 Reply

    Done

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:98 Reply

    Done
  24. Oli Bartsch commented on patch set 10 09/10/24, 15:56

    SynchronizeColPosAndCTypeWithDefaultLanguageTest.php:37

    Please add `self::assertFalse($subject->updateNecessary());` here to ensure the update was successfull.
  25. core-ci voted on patch set 10 V +1 09/10/24, 15:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65276

  26. André Buchmann commented on patch set 10 V -1 09/10/24, 20:10

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:88

    This check will always return result when you have a translated content element. Needs to check if the parent has different colPos or CType and only return those records.
  27. André Buchmann uploaded patch set 11 V +1 09/10/24, 20:11

  1. core-ci voted on patch set 11 V -1 09/10/24, 20:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65342

  2. Benni Mack commented on patch set 11 09/10/24, 20:23

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:88 Reply

    Yeah. I created a SQL query: SELECT trans.uid AS translatedid, trans.colPos AS translatedcol, trans.ctype AS transctype, trans.sys_language_uid AS translateduid, trans.pid AS translatedpid, trans.deleted AS transdeleted, trans.l18n_parent AS originalid, orig.colPos AS origcolpos, orig.CType as origctype, orig.deleted AS origdeleted FROM tt_content trans JOIN tt_content orig ON orig.uid=trans.l18n_parent AND (orig.colPos != trans.colPos OR orig.CType != trans.CType) AND orig.deleted=0 AND trans.deleted=0; ---> this one also takes only deleted=0 entries. I ran this one across some of my projects in production. It's scary to see that I found quite a few issues. I wonder if we should rather use a EXT:lowlevel CLI command to find them instead of doing the upgrade wizard.
  3. Benni Mack commented on patch set 11 09/10/24, 20:24

    tt_content.php:47

    we also need "l10n_display" IMHO, also below
  4. André Buchmann uploaded patch set 12 V -1 09/10/24, 20:46

  5. André Buchmann commented on patch set 11 09/10/24, 20:47

    tt_content.php:47 Reply

    Done

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:88 Reply

    Query optimized. I'm not sure about moving it to EXT:lowlevel

    SynchronizeColPosAndCTypeWithDefaultLanguageTest.php:37 Reply

    Done
  6. André Buchmann voted on patch set 12 CR +1 V +1 09/10/24, 20:52

  7. Benni Mack commented on patch set 12 09/10/24, 20:58

    I also tested this: - Change a translated CE (e.g. textpic) to "non-translated" via GUI - Change CType to "table" -> save - Re-connect -> CType is updated again to textpic So, this is really really good.

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:88 Reply

    Fine by me. Patch works for me.
  8. core-ci voted on patch set 12 V -1 09/10/24, 20:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65353

  9. André Buchmann uploaded patch set 13 CR +1 V +1 09/11/24, 06:08

  10. core-ci voted on patch set 13 V +1 09/11/24, 06:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65374

  11. André Buchmann voted on patch set 13 CR +1 V +1 09/11/24, 07:00

  12. Jochen Roth voted on patch set 13 CR +1 V +1 09/11/24, 07:01

  13. Oli Bartsch commented on patch set 13 CR -1 09/11/24, 07:23

    Reviewing
  14. Oli Bartsch commented on patch set 13 CR 0 09/11/24, 07:47

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:111

    Why do we exclude deleted records? In case such record is restored afterwards the migration will usually not triggered again -> leading to same misbehaviour. In case we keep the deleted check, we should add this to the tests.
  15. Oli Bartsch commented on patch set 13 09/11/24, 08:50

    Reply

    Done
  16. Oli Bartsch uploaded patch set 14 CR +1 V +1 09/11/24, 09:05

  17. Oli Bartsch commented on patch set 14 CR +1 V +1 09/11/24, 09:05

    SynchronizeColPosAndCTypeWithDefaultLanguage.php:111 Reply

    Done
  18. core-ci voted on patch set 14 V -1 09/11/24, 09:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65393

  19. André Buchmann commented on patch set 14 CR -1 09/11/24, 09:31

    Changing test cases to have - Wrong colPos - Wrong CType - Wrong colPos AND CType
  20. André Buchmann uploaded patch set 15 CR +1 V +1 09/11/24, 09:45

  21. core-ci voted on patch set 15 V -1 09/11/24, 10:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65406

  22. core-ci voted on patch set 15 V +1 09/11/24, 10:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65406

  23. André Buchmann voted on patch set 15 CR +1 V +1 09/11/24, 10:09

  24. Oli Bartsch voted on patch set 15 CR +2 V +2 09/11/24, 10:24

  25. Oli Bartsch merged patch set 16 09/11/24, 10:24