Review 13.4 Merged

87388[BUGFIX] Streamline midnight vs null handling of time fields

Benjamin Franzke CR +2 V +2 Hard +822 −90 updated 12/06/24, 09:11

Commit message

* Treat 00:00(:00) as valid time for nullable native time fields
   (has been misinterpreted as an empty-value before)

 * Treat database value 0 as empty for non-nullable integer-based
   time fields (has not been differentiated from nullable fields before)

 * Treat an empty date-input value as NULL in DataHandler if the field
   is nullable (same result as unchecking the "Set value" checkbox)

 * Respect that native time fields are nullable by default since #97367,
   as they are generated as NULLable database fields by default.
   This recent new TcaSchema default is now honored in DataHandler
   and FormEngine in order to allow midnight – 00:00:00 – to be a valid
   value of nullable native TIME fields.

 * Reallow to use non-nullable native datetime fields by setting
   `'nullable' => false` explicitly in the TCA schema
   (to allow full backwards compat for fields that were not nullable in
   TYPO3 v12).

 * Add testcases for non-nullable date/datetime/time(sec) fields
   with – nowadays invalid – zero dates 0000-00-00
   (testcases rely on mariadb safe mode NO_ZERO_DATE to be disabled
   and are therefore tested in a seperate functional testcase)

Note: 00:00:00 handling for time fields has previously been fixed in v12
by #97216, but was effectively broken with #92900, which changed the
reset value to 00:00:00 (which is the db-native empty value) instead of
a value that is intended to be understood by formengine (which used to
be timestamp integers, but is ISO8601 nowadays).

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
  • Verified V +2 Done
    • Benjamin Franzke +2
    • core-ci +1 CI

Issues 2

Files 28

Show 8 more files

Review log 23

  1. Benjamin Franzke uploaded patch set 1 12/06/24, 09:05

  2. core-ci voted on patch set 1 V +1 12/06/24, 09:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70696

  3. Benjamin Franzke merged patch set 2 12/06/24, 09:11