93548[FEATURE] Auto-map fields defined in TCA "ctrl" for Extbase models
Commit message
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
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-109494-AutoMapCtrlFieldsForExtbaseModels.rstnew+119 −0
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/ColumnMap.php+2 −0
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/ColumnMapFactory.php+9 −1
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMap.php+1 −1
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php+27 −2
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php+0 −3
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper/Classes/Domain/Model/CapabilitiesValueObject.phpnew+29 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper/Classes/Domain/Model/ExplicitSystemCapabilities.phpnew+30 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper/Classes/Domain/Model/SystemCapabilities.phpnew+36 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper/Configuration/Extbase/Persistence/Classes.php+12 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper/Configuration/TCA/tx_testdatamapper_domain_model_capabilities_value_object.phpnew+15 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper/Configuration/TCA/tx_testdatamapper_domain_model_explicit_system_capabilities.phpnew+32 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/test_data_mapper/Configuration/TCA/tx_testdatamapper_domain_model_system_capabilities.phpnew+18 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/DataMapperTest.php+38 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/SystemCapabilitiesTest.phpnew+259 −0
Review log 2029
Show 24 earlier messages
-
Anton Danilov uploaded patch set 1 04/06/26, 18:06
-
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
-
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
-
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
-
Soren Malling uploaded patch set 2
V +105/19/26, 20:04Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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 -
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
-
Soren Malling uploaded patch set 3
V -105/19/26, 20:20Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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
-
Anton Danilov uploaded patch set 4
V +106/05/26, 15:38v15 Feature with changelog and dedicated test Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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
-
Anton Danilov uploaded patch set 5
V -106/05/26, 15:49CGL issues fixes Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
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
-
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? -
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. -
Georg Ringer voted on patch set 5 CR 0 10/17/26, 09:54
-
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 😮 -
Anton Danilov uploaded patch set 6
CR -1V +110/19/26, 12:08DataMapFactory 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. -
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
-
Anton Danilov uploaded patch set 7
V -110/19/26, 12:27Renamed the value-object fixture to stay within the maximum file path length checked by CI -
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
-
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. -
Anton Danilov uploaded patch set 8
CR -1V +110/19/26, 14:24Rename ColumnMap::$isReadOnly to $isPersistable as requested -
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
-
Alexander Schnitzler voted on patch set 8 CR +1 V +1 10/19/26, 15:10
-
Georg Ringer voted on patch set 8 CR +1 V +1 10/19/26, 17:43
-
Garvin Hicking commented on patch set 8 CR +2 V +2 10/19/26, 20:03
Great improvements! Thanks for staying on it! -
Garvin Hicking merged patch set 9 10/19/26, 20:03