Review 13.4 Merged

88944[BUGFIX] Use DateTimeFactory for database datetime value interpretation

Benjamin Franzke CR +2 V +2 Hard +160 −152 updated 04/04/25, 09:45

Commit message

Fix display of native datetime fields in TCA record titles when
timezone is not UTC and apply `DateTimeFactory::createFromTimestamp()`
where the `(new DateTimeImmutable())->setTimestamp()` approach has been
used to workaround the PHP issue that direct `DateTime` creation from
timestamps does not respect current PHP timezone. The usage of the
`DateTimeFactory::createFromTimestamp()` wrapper hopefully helps to make
the intent of this chain clear and to prevent recreating the same
issue in new code as in #106453.

Also adapt one aspect of the recently introduced DateTimeFactory
to correctly initialize integer based format=time(sec) fields
independent from current daylight saving time offset and add
missing unit tests to TcaRecordTitleTest for this case.

Extbase DateTime resolution will be address with a separate patch
and is marked as a TODO for the time being.

Review

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

Issues 4

Files 18

Review log 46

  1. Benjamin Franzke commented on patch set 1 04/04/25, 08:16

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/backend/Classes/Form/FormDataProvider/TcaRecordTitle.php
  2. Benjamin Franzke uploaded patch set 2 04/04/25, 08:26

  3. core-ci voted on patch set 1 V -1 04/04/25, 08:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76988

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

  5. Benjamin Franzke commented on patch set 2 CR +2 V +2 04/04/25, 09:45

    This change is ready for review.
  6. Benjamin Franzke merged patch set 3 04/04/25, 09:45