Review main Merged

93548[FEATURE] Auto-map fields defined in TCA "ctrl" for Extbase models

Anton Danilov CR +2 V +2 Hard +627 −7 updated 10/19/26, 20:03

Commit message

Only four capabilities have no default "columns" definition in the
TCA schema but are defined via "ctrl": "tstamp", "crdate", "delete" and
"sortby". The Extbase DataMapper did not map them, so model properties
for them were not hydrated without duplicating the TCA "columns"
section. Other "ctrl" based fields like the enable columns, "editlock"
and "descriptionColumn" already get a "columns" definition since v13.3
and were therefore already mapped.

`DataMapFactory` now creates a passthrough column map for every system
capability that has no explicit "columns" definition. An explicit
"columns" definition still takes precedence.

Because these fields belong to the core, they are mapped read-only: the
`DataMapper` hydrates them like any other column, but the persistence
backend never writes them back, not even when the model property
changes. "deleted" can therefore only be changed through remove(). This
is intentional: a writable "deleted" property would bypass remove(),
cascading and the reference index, and a writable "sorting" property
would conflict with the sorting Extbase manages for relations.

Functional tests cover hydration, the ignored writes and that remove()
still soft-deletes, and the changelog entry documents the behaviour.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Georg Ringer +1
    • Alexander Schnitzler +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Georg Ringer +1
    • Alexander Schnitzler +1
    • core-ci +1 CI

Issues 1

Files 15

Review log 2029

Show 24 earlier messages
  1. Anton Danilov uploaded patch set 1 04/06/26, 18:06

  2. core-ci voted on patch set 1 V -1 04/06/26, 18:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99652

  3. core-ci voted on patch set 1 V +1 04/07/26, 08:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99652

  4. Georg Ringer commented on patch set 1 CR -2 04/15/26, 06:33

    giving a -2 here to avoid being merged: this is more a feature for me and it might be breaking, so need a feature rst at least. for v15 this sounds doable but no backport will be done
  1. Soren Malling uploaded patch set 2 V +1 05/19/26, 20:04

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  2. Soren Malling commented on patch set 2 05/19/26, 20:05

    Found it interesting, did a try on adding a test to describe this change and push it forward
  3. core-ci voted on patch set 2 V -1 05/19/26, 20:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102236

  4. Soren Malling uploaded patch set 3 V -1 05/19/26, 20:20

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  5. core-ci voted on patch set 3 V +1 05/19/26, 20:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102237

  6. Anton Danilov uploaded patch set 4 V +1 06/05/26, 15:38

    v15 Feature with changelog and dedicated test Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  7. core-ci voted on patch set 4 V -1 06/05/26, 15:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103041

  8. Anton Danilov uploaded patch set 5 V -1 06/05/26, 15:49

    CGL issues fixes Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  9. core-ci voted on patch set 5 V +1 06/05/26, 15:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103042

  10. Soren Malling commented on patch set 5 10/02/26, 07:26

    @georg.ringer@gmail.com Could you remove the -2 and give it a new review?
  11. Alexander Schnitzler commented on patch set 5 CR -1 V -1 10/17/26, 06:56

    Thanks for picking this up. Reading `tstamp`/`crdate` without duplicating the `ctrl` fields as `passthrough` columns is a long-standing wish, and the schema API is the right place to get them from. These fields belong to the core, not to the model: Extbase may read them, but must never write them. The patch currently makes them writable as well, because `Backend::persistObject()`/`insertObject()` write every property for which `DataMap::isPersistableProperty()` is true: - a model property `deleted` can set `deleted = 1` via `update()`, bypassing `remove()`, cascade and the reference index (the new `SystemCapabilities` fixture has exactly such a property), - a changed `crdate` property is written on update, - a `sorting` property competes with the sorting Extbase maintains for MM/foreign_field children, - existing models with a property named `hidden`, `description`, `sorting` etc. that is not backed by a TCA column get it hydrated and written back — the RST says they "continue to work unchanged", which isn't the case. Please make columns that only exist via a `ctrl` capability read-only. Hydrate them, never write them; fields with their own `columns` definition keep today's behaviour. Once that's proven with a functional test, I will +1.
  12. Georg Ringer voted on patch set 5 CR 0 10/17/26, 09:54

  13. Soren Malling commented on patch set 5 10/19/26, 08:32

    Reply

    @git@alexanderschnitzler.de That's some damn good input - didn't think about that at all 😮
  14. Anton Danilov uploaded patch set 6 CR -1 V +1 10/19/26, 12:08

    DataMapFactory now adds passthrough column maps for "tstamp", "crdate", "delete" and "sortby" only when the TCA has no explicit "columns" definition for them. ColumnMap carries an isReadOnly flag, and DataMap::isPersistableProperty() returns false for these columns, so Extbase hydrates them but the persistence backend never writes them back. "deleted" can only be changed through remove(), and "sorting" cannot conflict with the sorting Extbase manages for relations. Fields with an explicit "columns" definition keep their established read and write behaviour. Added SystemCapabilitiesTest for hydration, ignored writes on insert and update, remove() still soft-deleting, value object identity and the explicit-columns case, plus a DataMapper mapping test. The changelog entry now documents the read-only behaviour.
  15. core-ci voted on patch set 6 V -1 10/19/26, 12:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111632

  16. Anton Danilov uploaded patch set 7 V -1 10/19/26, 12:27

    Renamed the value-object fixture to stay within the maximum file path length checked by CI
  17. core-ci voted on patch set 7 V +1 10/19/26, 12:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111639

  18. Alexander Schnitzler commented on patch set 7 CR -1 V +1 10/19/26, 13:59

    Thanks, this addresses both points from my last review: fields that only exist through a ctrl capability are hydrated but never written, and explicit columns definitions keep their behaviour. Without the check in `DataMap::isPersistableProperty()`, 4 of the 7 new tests fail, so the tests really pin the write protection. One request on naming: `ColumnMap::$isReadOnly` reads like TCA config.readOnly, but that is a display-only option. The DataHandler still writes such fields, and Extbase must keep writing them too. I would use `ColumnMap::$isPersistable`. People familiar with the extbase framework understand this at once.
  19. Anton Danilov uploaded patch set 8 CR -1 V +1 10/19/26, 14:24

    Rename ColumnMap::$isReadOnly to $isPersistable as requested
  20. core-ci voted on patch set 8 V +1 10/19/26, 14:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111657

  21. Anton Danilov commented on patch set 8 10/19/26, 14:33

    Reply

    Done

    Reply

    Done
  22. Alexander Schnitzler voted on patch set 8 CR +1 V +1 10/19/26, 15:10

  23. Georg Ringer voted on patch set 8 CR +1 V +1 10/19/26, 17:43

  24. Garvin Hicking commented on patch set 8 CR +2 V +2 10/19/26, 20:03

    Great improvements! Thanks for staying on it!
  25. Garvin Hicking merged patch set 9 10/19/26, 20:03