Review main Merged

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

Benjamin Franzke CR +2 V +2 Hard +482 −39 updated 05/23/25, 14:22

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
    • Markus Klein +1
    • Andreas Kienast +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Andreas Kienast +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 5

Files 15

Review log 3043

Show 1118 earlier messages
  1. Benjamin Franzke uploaded patch set 1 03/29/25, 16:47

  2. Benjamin Franzke marked it work in progress 03/29/25, 16:47

  3. core-ci voted on patch set 1 V +1 03/29/25, 16:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76644

  4. Benjamin Franzke uploaded patch set 2 V +1 03/30/25, 05:13

  5. core-ci voted on patch set 2 V +1 03/30/25, 05:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76660

  6. Benjamin Franzke uploaded patch set 3 V +1 03/30/25, 18:53

  7. core-ci voted on patch set 3 V +1 03/30/25, 19:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76679

  8. Benjamin Franzke uploaded patch set 4 V +1 03/31/25, 21:02

  9. core-ci voted on patch set 4 V +1 03/31/25, 21:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76736

  10. Benjamin Franzke uploaded patch set 5 V +1 04/03/25, 19:21

  11. core-ci voted on patch set 5 V +1 04/03/25, 19:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76967

  12. Benjamin Franzke rebased onto patch set 6 V +1 04/04/25, 12:19

  13. core-ci voted on patch set 6 V +1 04/04/25, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77002

  14. Benjamin Franzke rebased onto patch set 7 V +1 04/07/25, 13:57

  15. core-ci voted on patch set 7 V +1 04/07/25, 14:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77141

  16. Benjamin Franzke wrote 04/07/25, 14:34

    Topic set to extbase
  17. Benni Mack commented on patch set 7 04/07/25, 17:13

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:54

    should we explain the difference of that change based on CEST / CET?

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:60

    "Nullable" ?

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:84

    "Not that" = "Note that"?
  18. Benjamin Franzke uploaded patch set 8 V +1 04/07/25, 17:31

  1. Benjamin Franzke commented on patch set 8 04/07/25, 17:31

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:54 Reply

    Ack, added an example as explanation.

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:60 Reply

    Done

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:84 Reply

    Done
  2. core-ci voted on patch set 8 V +1 04/07/25, 17:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77156

  3. Benjamin Franzke rebased onto patch set 9 V +1 04/11/25, 09:02

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

  5. Benni Mack commented on patch set 9 04/11/25, 12:04

    Thanks for the patch. Apart from the minor textual changes, this is really cool! two things: 1. Why not enforce this option in v14 already? 2. Can / should we elaborate in the RST what the extension authors should have a look at and might need adaptions? I mean, if I read through the RST, I'd like to know if I'm affected if I have an Extbase extension with non-native datetime, and no timesec etc. I'm OK... you know? And: I most likely have some quirks in my models to overcome this problem, so this should also be mentioned that in v14 people should remove their timezone calculation magic.

    DefaultConfigurationDescription.yaml:197

    should we close the </li>s?

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:30

    consistent
  6. Benjamin Franzke commented on patch set 9 04/11/25, 13:25

    Reply

    > Why not enforce this option in v14 already? You mean not just defaulting to it (also for updated instances), but completely removing the possibility to revert the behavior and effectively remove the old code directly? Two (and a half) reasons: 1. It's very old extbase behavior 2. We had no deprecation 2a could be a separate change > I mean, if I read through the RST, I'd like to know if I'm affected if I have an Extbase extension with non-native datetime, and no timesec etc. I'm OK... you know? I know what you mean, and actually tried to accomplish that with the RST, but obviously failed. It's a) not that simple and b) a guessing game… Will try to iterate on that.
  7. Benjamin Franzke uploaded patch set 10 V +1 04/11/25, 13:29

  8. Benjamin Franzke commented on patch set 10 04/11/25, 13:29

    Important-106467-AlignExtbaseDateTimeHandlingToFormEngineAndDataHandler.rst:30 Reply

    Done
  9. core-ci voted on patch set 10 V +1 04/11/25, 13:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77540

  10. Georg Ringer voted on patch set 10 CR +2 05/09/25, 07:11

  11. Georg Ringer voted on patch set 10 CR 0 05/09/25, 07:11

  12. Benjamin Franzke uploaded patch set 11 V +1 05/11/25, 11:20

  13. Benjamin Franzke commented on patch set 11 05/11/25, 11:20

    Reply

    Done

    DefaultConfigurationDescription.yaml:197 Reply

    Done
  14. core-ci voted on patch set 11 V -1 05/11/25, 11:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78774

  15. Benjamin Franzke uploaded patch set 12 V -1 05/11/25, 14:33

  16. core-ci voted on patch set 12 V +1 05/11/25, 14:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78778

  17. Benjamin Franzke rebased onto patch set 13 V +1 05/20/25, 12:19

    Rebase
  18. core-ci voted on patch set 13 V +1 05/20/25, 12:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79239

  19. Benni Mack voted on patch set 13 CR +1 V +1 05/21/25, 14:33

  20. Markus Klein voted on patch set 13 CR +1 05/22/25, 17:53

  21. Andreas Kienast voted on patch set 13 CR +1 V +1 05/23/25, 10:05

  22. Benjamin Franzke voted on patch set 13 CR +2 V +2 05/23/25, 10:31

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

  24. Mathias Brodala commented on patch set 14 05/23/25, 10:46

    Hm, but this is what happens due to being set in DefaultConfiguration instead of FactoryConfiguration or do I miss something?
  25. Benjamin Franzke commented on patch set 14 05/23/25, 14:22