Review main Merged

88796[BUGFIX] Group log entries per correct timezone

Benjamin Franzke CR +2 V +2 Easy +5 −6 updated 03/31/25, 14:14

Commit message

Account for localtime offsets in log entry per-day
resolution. Also streamline the rendering to make
use of DateTime objects directly instead of passing
timestamps around.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Georg Ringer +1
    • Markus Klein +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Georg Ringer +1
    • Markus Klein +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 2226

Show 1 earlier messages
  1. Benjamin Franzke uploaded patch set 1 03/27/25, 12:11

  1. core-ci voted on patch set 1 V +1 03/27/25, 12:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76449

  2. Benjamin Franzke uploaded patch set 2 V +1 03/27/25, 14:10

  3. core-ci voted on patch set 2 V +1 03/27/25, 14:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76469

  4. Benjamin Franzke uploaded patch set 3 V +1 03/28/25, 05:47

  5. core-ci voted on patch set 3 V +1 03/28/25, 05:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76549

  6. Benni Mack voted on patch set 3 CR +1 V +1 03/28/25, 07:42

  7. Markus Klein commented on patch set 3 03/28/25, 08:39

    The patch does not make a difference for my local v14 test instance.
  8. Markus Klein commented on patch set 3 03/28/25, 08:39

    Reply

    Even without the patch the times seem correct. e.g. my be login time
  9. Benni Mack commented on patch set 3 03/28/25, 08:48

    Reply

    good that you set phpTimeZone properly in your project from the beginning ;)
  10. Benjamin Franzke commented on patch set 3 03/28/25, 09:07

    Reply

    The filter dates were implicitly fixed by https://review.typo3.org/c/Packages/TYPO3.CMS/+/86888 (are fixed explicitly in the backports) but the list should be wrong in v14/main with: ``` $GLOBALS['TYPO3_CONF_VARS']['SYS']['phpTimeZone'] = 'Europe/Berlin'; ``` Maybe you tested with UTC(?)
  11. Markus Klein commented on patch set 3 03/28/25, 11:15

    Reply

    My local installation runs with Europe/Vienna. Set in the PHP config. And my logs match my Laptop's watch (which is local time obviously)
  12. Benjamin Franzke commented on patch set 3 CR -1 03/28/25, 12:14

    Reply

    Ack, can confirm, thanks! So I was fixing the filter bug (see backports) and assumed that the was rendered date was wrong as well since it uses `@` in `<f:format.date>@{…}</f:format.date>` and I assumed the same issue as in DateTime constructor would happen. …but the format.date view helper actually prints local time despite the @-qualifier, since it resolved the timestamp from the string value and sets via DateTime::setTimestamp instead of passing it to the DateTime constructor and therefore is "lucky" to create localtime: https://github.com/TYPO3/typo3/blob/c2f7c2ca/typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php#L178-L182 But then `\DateTimeImmutable::createFromFormat('U', (string)$entry->getTstamp())` in `BackendLogController.php` was still wrong and caused wrong date-associations around midnight if the timezone has an offset . I still think it makes sense to create a proper DateTime object, but I will adapt the commit message to reflect that we're effectively "only" fixing the grouping here.
  13. Benjamin Franzke marked it work in progress 03/28/25, 12:15

  14. Markus Klein commented on patch set 3 03/28/25, 15:05

    Reply

    Thanks for checking!
  15. Markus Klein commented on patch set 3 03/28/25, 15:06

    Reply

    > therefore is "lucky" to create localtime Actually on purpose: That was my fix from last year: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81915
  16. Benjamin Franzke commented on patch set 3 03/28/25, 15:34

    Reply

    I see, thanks!
  17. Benjamin Franzke uploaded patch set 4 CR +1 V +1 03/31/25, 07:44

  18. Benjamin Franzke commented on patch set 4 03/31/25, 07:44

    Reply

    Clarified in commit message, that this fixes the grouping.
  19. Benjamin Franzke marked it ready for review 03/31/25, 07:44

  20. core-ci voted on patch set 4 V +1 03/31/25, 07:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76711

  21. Georg Ringer voted on patch set 4 CR +1 V +1 03/31/25, 11:48

  22. Benni Mack voted on patch set 4 CR +1 V +1 03/31/25, 13:00

  23. Markus Klein voted on patch set 4 CR +1 V +1 03/31/25, 13:49

  24. Benjamin Franzke voted on patch set 4 CR +2 V +2 03/31/25, 14:13

  25. Benjamin Franzke merged patch set 5 03/31/25, 14:14