Issue Bug Resolved

#110320Save to Database Finisher do not set crdate

Christian Rath-Ulrich 07/29/26, 12:49 updated 09/18/26, 16:40

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

  1. Christian Rath-Ulrich commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-16T19:45:11+00:00" > 09/16/26, 19:45 </span>

    Applied in changeset commit:b902b15c587ba2bf62c81644b0c4fce8710b7c9c.

  2. Gerrit Code Review pushed patch set 2 for 14.3 to change 95889 status Resolved Under Review <span data-processor="relativetime" data-value="2026-09-18T05:10:34+00:00" > 09/18/26, 05:10 </span>

  3. Christian Rath-Ulrich commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-09-18T16:40:09+00:00" > 09/18/26, 16:40 </span>

    Applied in changeset commit:0af29ee032986d89695ff56d68d090c794e06069.