#110320Save to Database Finisher do not set crdate
Description
Automatically set crdate and tstamp in SaveToDatabaseFinisher
Problem
When using the SaveToDatabase finisher to persist form submissions to a database table, system timestamp fields are not set automatically.
Unlike the core DataHandler, the finisher only writes values explicitly configured via elements or databaseColumnMappings. As a result, records inserted through the finisher often end up with empty or default crdate and tstamp values, even when the target table defines these fields in TCA.
Currently, integrators must work around this manually in every form definition, for example:
databaseColumnMappings:
tstamp:
value: '{__currentTimestamp}'
crdate:
value: '{__currentTimestamp}'
This is easy to forget, inconsistent with core TYPO3 behavior, and adds unnecessary configuration overhead.
Expected behavior
The SaveToDatabaseFinisher should automatically populate timestamp system fields based on the TCA schema of the target table, similar to DataHandler.
On insert: set both crdate and tstamp if the table supports them
On update: update only tstamp
Use $GLOBALS[‘EXEC_TIME’] as the timestamp source
Do nothing for tables without a TCA schema (for example MM tables)
Solution
Extend SaveToDatabaseFinisher with a new method, addSystemFieldsToDatabaseData(), which is called before the database insert/update.
The method:
Resolves the target table via TcaSchemaFactory
Checks for CreatedAt and UpdatedAt capabilities in the TCA schema
Adds the corresponding field values to the data array before saving
This removes the need for manual {__currentTimestamp} mappings in most cases and aligns the finisher with standard TYPO3 record handling.
Reviews 2
History 210
-
Gerrit Code Review pushed patch set 1 for main to change 94985 status
NewUnder Review <span data-processor="relativetime" data-value="2026-07-29T12:54:18+00:00" > 07/29/26, 12:54 </span> -
Gerrit Code Review pushed patch set 2 for main to change 94985 <span data-processor="relativetime" data-value="2026-07-29T13:08:01+00:00" > 07/29/26, 13:08 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 94985 <span data-processor="relativetime" data-value="2026-08-08T19:23:00+00:00" > 08/08/26, 19:23 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 94985 <span data-processor="relativetime" data-value="2026-09-16T08:19:38+00:00" > 09/16/26, 08:19 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95889 <span data-processor="relativetime" data-value="2026-09-16T19:42:13+00:00" > 09/16/26, 19:42 </span>
-
Christian Rath-Ulrich commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-16T19:45:11+00:00" > 09/16/26, 19:45 </span> -
Gerrit Code Review pushed patch set 2 for 14.3 to change 95889 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-09-18T05:10:34+00:00" > 09/18/26, 05:10 </span> -
Gerrit Code Review pushed patch set 3 for 14.3 to change 95889 <span data-processor="relativetime" data-value="2026-09-18T16:25:11+00:00" > 09/18/26, 16:25 </span>
-
Gerrit Code Review pushed patch set 4 for 14.3 to change 95889 <span data-processor="relativetime" data-value="2026-09-18T16:25:53+00:00" > 09/18/26, 16:25 </span>
-
Christian Rath-Ulrich commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-09-18T16:40:09+00:00" > 09/18/26, 16:40 </span>Applied in changeset commit:0af29ee032986d89695ff56d68d090c794e06069.
Applied in changeset commit:b902b15c587ba2bf62c81644b0c4fce8710b7c9c.