Review 13.4 Merged

88945[BUGFIX] Align Extbase DateTime handling to FormEngine and DataHandler

Benjamin Franzke CR +2 V +2 Hard +485 −38 updated 05/23/25, 10:41

Commit message

Adapt various extbase DateTime issues by appyling the
generic DateTimeFactory added in #106453 via a new
feature flag: `extbase.consistentDateTimeHandling`.

Do not change behavior for existing v13 instances since the bugs have
been present for a decade and there are many workarounds in the wild,
which need to be dismantled once this feature flag is disabled.

Map date and datetime with named timezone instead of offset
-----------------------------------------------------------

Ensure that Extbase DataMapper converts dates from integer based
database fields to DateTime instances that use the current server date
timezone (e.g., Europe/Berlin) and not just the time offset of the
current server timezone (e.g., +01:00).

This prevents timezone shifts when modifying the resulting `\DateTime`
object across daylight saving time boundaries.

This resolves #68651 and #80349.

Interpret integer based time fields as seconds without timezone offset
----------------------------------------------------------------------

The Extbase DataMapper will interpret `format=time` or `format=timesec`
datetime fields as seconds without timezone offset, like FormEngine and
DataHandler do.

This resolves #106364.

Interpret 00:00:00 as non empty time value for nullable time properties
-----------------------------------------------------------------------

Nullable format=time or format=timesec or dbType=time fields can
use 00:00:00 to represent midnight (this value has been used in
non-nullable fields to represent an empty value). Adapt the DateTime
mapper to understand this format. See #105666 for recent FormEngine
fixes in this regard.

This resolves #106364.

Construct format=time or dbType=time properties based on 1970-01-01
-------------------------------------------------------------------

DateTime objects that map to native TIME fields or integer based
fields configured with format=time are now initialized with
1970-01-01 as day-part instead of the current day, as this is what
the database value refers to and results in consistent values
independent from the day where the query is performed.

Align persistence to database to match DataHandler algorithm
------------------------------------------------------------

Use the DataHandler algorithm for the mapping of DateTime objects
to database values.
This causes non-localtime timezone offsets to be respected for
native datetime fields.

Review

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

Issues 5

Files 16

Review log 712

  1. Benjamin Franzke uploaded patch set 1 04/04/25, 09:28

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

  3. Benjamin Franzke uploaded patch set 2 04/04/25, 14:10

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  4. core-ci voted on patch set 2 V +1 04/04/25, 14:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77007

  5. Benjamin Franzke uploaded patch set 3 V +1 04/07/25, 17:32

  6. core-ci voted on patch set 3 V +1 04/07/25, 17:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77157

  7. Benjamin Franzke uploaded patch set 4 V +1 04/11/25, 13:26

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

  9. Benjamin Franzke uploaded patch set 5 V +1 05/23/25, 10:31

  10. Benjamin Franzke marked it ready for review 05/23/25, 10:31

  11. core-ci voted on patch set 5 V +1 05/23/25, 10:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79419

  12. Benjamin Franzke merged patch set 6 05/23/25, 10:41