Review main Merged

89048[BUGFIX] Fix datetime default value inflation with default=0

Benjamin Franzke CR +2 V +2 Easy +12 −0 updated 04/11/25, 19:59

Commit message

Since #105549 DataHandler interprets `0` as a unix timestamp in any
case (and never as a possible empty value) to provide a reliable data
interface where types – in this case `type=datetime` – consistently
define logical value interpretation, without influence by the
underlying persistence strategies.

This conflicts with the current DataHandler default value inflation
which adds the database-oriented default value `0` to the input array,
and expects `checkValueForDatetime` to pass this `0` through, as is.
(Note: this is used if a field is hidden in FormEngine and is therefore
filled in DataHandler before persistence)

This is not correct. For type=datetime 0 means UTC-0 on a logical level,
but empty on a database level, *if* the field is not nullable and
an integer based field. Do avoid this variances in an API #105549
enforced interpretation of 0 as always UTC-0.

A "new record array" shall not mess with persistence details at all
and therefore only contain logical values, no persistence restriction
influenced values.

Adapt the `DateTimeFieldType` schema type to map a configured `0`
default value to the intended logical value (which is `null`).
DataHandler will initialize rows (filled by `newFieldArray()`) for
disabled fields with this logical value and map to the database value
`0` in `checkValueForDatetime`.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Andreas Kienast +1
    • Benni Mack +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 811

  1. Benjamin Franzke uploaded patch set 1 04/11/25, 07:37

  2. core-ci voted on patch set 1 V +1 04/11/25, 07:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77496

  3. Benjamin Franzke uploaded patch set 2 V +1 04/11/25, 08:57

  4. core-ci voted on patch set 2 V +1 04/11/25, 09:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77507

  5. Andreas Kienast voted on patch set 2 CR +1 04/11/25, 10:49

  6. Andreas Kienast uploaded patch set 3 CR +1 V +1 04/11/25, 10:54

  7. Andreas Kienast voted on patch set 3 CR +1 04/11/25, 10:54

  8. core-ci voted on patch set 3 V +1 04/11/25, 11:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77515

  9. Benni Mack voted on patch set 3 CR +1 V +1 04/11/25, 15:41

  10. Georg Ringer voted on patch set 3 CR +2 V +2 04/11/25, 19:58

  11. Georg Ringer merged patch set 4 04/11/25, 19:59