Review main Merged

72275[BUGFIX] Properly handle l10n_display=displayAsReadonly

Oli Bartsch CR +2 V +2 Hard +272 −16 updated 11/30/21, 20:39

Commit message

TCA provides the "l10n_display" configuration,
which allows to define how TCA fields should
behave in localizations. One of the possible
values is "defaultAsReadonly", which just
renders the default records value in a
readonly field. This is non functional
and only used in FormEngine.

Common use cases are fields, which do not
change in a localization, e.g. the author
of a blog article.

How did this work?

The SingleFieldContainer, entry point of
each TCA field, checked whether the option
is set and if so, overrides the "itemFormElValue"
- containing the processed database field value -
with the raw field value of the default record
and automatically sets the field to "readOnly".

This already worked for basic types, such
as "input", "check" or "radio", since their
database values are usually not further
processed by any form data provider.

However, when it comes to types, dealing with
relations or enrichments, just using the default
records' raw database value did mostly not work.

Therefore, this patch removes the replacement
from SingleFieldContainer and adds a new
form data provider, dealing with this task.
This way, we ensure all following data providers
can process the correct value (either the
current database value or the default
records value).

This can be tested with a new styleguide record:
https://github.com/TYPO3/styleguide/pull/254

For some cases (mostly MM lookups and inline),
the "l10n_mode" needs to be set to "exclude",
when using "defaultAsReadonly", since otherwise
the DataHandler doesn't hold the relations in sync.

Note: TCA type "slug" and TCA renderType
"belayoutwizard" do not yet handle readOnly
at all, because this option is not supported
as "columns config". This is fixed in two
separate patches (#96096 and #96095).

Note: TCA type "flex" does still not work,
since the corresponding containers do not
implement readOnly handling at all. Fixing
this will be done in a separate patch.

Review

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

Issues 3

Files 8

Review log 3053

Show 1528 earlier messages
  1. Oli Bartsch uploaded patch set 1 11/23/21, 15:35

  2. Oli Bartsch uploaded patch set 2 11/23/21, 15:41

  3. core-ci voted on patch set 2 V -1 11/23/21, 15:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19681

  4. core-ci voted on patch set 1 V -1 11/23/21, 15:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19680

  5. Oli Bartsch uploaded patch set 3 11/23/21, 15:51

  6. core-ci voted on patch set 3 V +1 11/23/21, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19682

  7. Oli Bartsch uploaded patch set 4 11/24/21, 14:02

  8. core-ci voted on patch set 4 V +1 11/24/21, 14:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19701

  9. Oli Bartsch uploaded patch set 5 11/24/21, 23:14

  10. core-ci voted on patch set 5 V +1 11/24/21, 23:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19717

  11. Oli Bartsch uploaded patch set 6 11/25/21, 16:49

  12. core-ci voted on patch set 6 V +1 11/25/21, 17:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19746

  13. Oli Bartsch uploaded patch set 7 11/25/21, 20:15

  14. core-ci voted on patch set 7 V +1 11/25/21, 20:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19762

  15. Oli Bartsch uploaded patch set 8 11/25/21, 22:23

  16. core-ci voted on patch set 8 V +1 11/25/21, 22:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19771

  17. Oli Bartsch uploaded patch set 9 11/25/21, 23:26

  18. core-ci voted on patch set 9 V +1 11/25/21, 23:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19772

  19. Oli Bartsch updated the commit message in patch set 10 11/26/21, 00:03

  20. core-ci voted on patch set 10 V -1 11/26/21, 00:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19773

  21. core-ci commented on patch set 10 11/26/21, 00:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19773

  22. Oli Bartsch commented on patch set 10 V -1 11/26/21, 00:46

    Will try another solution, handling this more general.
  23. Oli Bartsch uploaded patch set 11 11/26/21, 12:03

  24. Christian Kuhn commented on patch set 11 11/26/21, 12:12

    will review.
  25. core-ci voted on patch set 11 V +1 11/26/21, 12:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19788

  26. Oli Bartsch uploaded patch set 12 11/26/21, 13:35

  27. core-ci voted on patch set 12 V +1 11/26/21, 13:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19791

  28. Oli Bartsch uploaded patch set 13 11/26/21, 13:59

  1. core-ci voted on patch set 13 V +1 11/26/21, 14:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19792

  2. Oli Bartsch uploaded patch set 14 11/26/21, 14:55

  3. Oli Bartsch updated the commit message in patch set 15 11/26/21, 14:56

  4. core-ci voted on patch set 15 V -1 11/26/21, 15:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19796

  5. core-ci voted on patch set 14 V -1 11/26/21, 15:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19795

  6. Oli Bartsch uploaded patch set 16 11/26/21, 15:36

  7. core-ci voted on patch set 16 V -1 11/26/21, 15:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19802

  8. core-ci voted on patch set 16 V +1 11/26/21, 16:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19802

  9. Jochen Roth commented on patch set 16 11/26/21, 18:04

    One
  10. Oli Bartsch uploaded patch set 17 11/26/21, 20:47

  11. Oli Bartsch commented on patch set 17 11/26/21, 20:50

    Reply

    Done
  12. core-ci voted on patch set 17 V +1 11/26/21, 21:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19835

  13. Benni Mack wrote 11/29/21, 10:20

    Change destination moved from master to main
  14. Oli Bartsch updated the commit message in patch set 18 11/29/21, 13:04

  15. core-ci voted on patch set 18 V +1 11/29/21, 13:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19989

  16. Oli Bartsch rebased onto patch set 19 11/29/21, 21:06

  17. core-ci voted on patch set 19 V +1 11/29/21, 21:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20162

  18. Oli Bartsch uploaded patch set 20 11/30/21, 16:57

  19. Christian Kuhn rebased onto patch set 21 11/30/21, 17:33

  20. core-ci voted on patch set 20 V -1 11/30/21, 17:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20246

  21. core-ci voted on patch set 21 V +1 11/30/21, 17:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20254

  22. Christian Kuhn voted on patch set 21 V +1 CR +1 11/30/21, 19:36

  23. Benni Mack voted on patch set 21 V +1 CR +1 11/30/21, 19:57

  24. Oli Bartsch voted on patch set 21 V +2 CR +2 11/30/21, 20:38

  25. Oli Bartsch merged patch set 22 11/30/21, 20:39