#109494Extbase DataMapper ignores fields defined in TCA "ctrl"
Description
Fields defined in the `ctrl` section of a TCA (like `tstamp` or `crdate`) are not automatically mapped to properties in an Extbase domain model. They must also be defined in the `columns` section for the `DataMapper` to recognise them when reading database records.
This leads to an inconsistent developer experience: the system knows the field exists and can write to it automatically (via `DataMap`), but cannot read it into a model without additional boilerplate.
A typical TCA setup:
'table' => [
'ctrl' => [
'tstamp' => 'tstamp',
'crdate' => 'crdate',
],
// 'tstamp' and 'crdate' are NOT defined in 'columns'
'columns' => [
// ...
],
],
And a model:
class MyModel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
protected ?int $tstamp = null;
public function getTstamp(): ?int
{
return $this->tstamp;
}
}
*Expected behaviour:*
The `$tstamp` property should be populated with the value from the database.
*Actual behaviour:*
The `$tstamp` property remains `null` because the DataMapper only maps fields listed in the `columns` section.
Proposed Solution
Modify the `DataMapFactory` to automatically generate a simple `ColumnMap` for fields defined in `ctrl` (e.g., `tstamp`, `crdate` etc) if they are missing from the `columns` section. This would be done by checking the `TcaSchemaCapability` for `UpdatedAt`, `CreatedAt`, etc.
The `DataMapper` already loops over all persistable properties with a valid `ColumnMap`. By adding these missing maps, the fields would be hydrated without any additional TCA configuration.
Reviews 1
Related issues 1
Files 1
History 513
-
Anton Danilov changed attached 109494.patch <span data-processor="relativetime" data-value="2026-04-06T14:49:47+00:00" > 04/06/26, 14:49 </span>
-
Anton Danilov changed Related to #104311 <span data-processor="relativetime" data-value="2026-04-06T14:50:14+00:00" > 04/06/26, 14:50 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-04-06T16:36:51+00:00" > 04/06/26, 16:36 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 93548 status
NewUnder Review <span data-processor="relativetime" data-value="2026-04-06T18:06:09+00:00" > 04/06/26, 18:06 </span> -
Georg Ringer changed Duplicates #94961 <span data-processor="relativetime" data-value="2026-04-06T18:29:22+00:00" > 04/06/26, 18:29 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 93548 <span data-processor="relativetime" data-value="2026-05-19T20:04:15+00:00" > 05/19/26, 20:04 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 93548 <span data-processor="relativetime" data-value="2026-05-19T20:20:25+00:00" > 05/19/26, 20:20 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 93548 <span data-processor="relativetime" data-value="2026-06-05T15:38:51+00:00" > 06/05/26, 15:38 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 93548 <span data-processor="relativetime" data-value="2026-06-05T15:49:24+00:00" > 06/05/26, 15:49 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 93548 <span data-processor="relativetime" data-value="2026-10-19T12:08:32+00:00" > 10/19/26, 12:08 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 93548 <span data-processor="relativetime" data-value="2026-10-19T12:27:37+00:00" > 10/19/26, 12:27 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 93548 <span data-processor="relativetime" data-value="2026-10-19T14:24:18+00:00" > 10/19/26, 14:24 </span>
-
Anton Danilov commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-19T20:05:14+00:00" > 10/19/26, 20:05 </span>Applied in changeset commit:deee538c4ab152ae8f8a4508e5979cd171b20005.
I’ve faced this a few times and I’m not remembering what the reasons where (if any) to not have this. Maybe I remember later. ;)
Would you like to add your patch to our review system so it can also be attributed to you? We’ll probably need to add verifying patches for this too, and very likely adapt tests.
Thanks!