81915[BUGFIX] Use correct timezones with timestamp based \DateTime
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Oliver Klee +1
- Garvin Hicking +1
- Andreas Wolf +1
-
Verified V +2 Done
- Stefan Bürk +2
- Oliver Klee +1
- Garvin Hicking +1
- core-ci +1 CI
Issues 2
Files 20
- Build/phpstan/phpstan-baseline.neon+0 −5
- typo3/sysext/adminpanel/Classes/Modules/PreviewModule.php2+17 −30
- typo3/sysext/backend/Classes/Http/Application.php2+6 −1
- typo3/sysext/backend/Classes/Routing/PreviewUriBuilder.php+5 −2
- typo3/sysext/core/Classes/Console/CommandApplication.php+6 −1
- typo3/sysext/core/Classes/Context/Context.php+6 −1
- typo3/sysext/core/Classes/Localization/DateFormatter.php+2 −2
- typo3/sysext/core/Classes/Mail/MailMessage.php3+1 −1
- typo3/sysext/core/Classes/Security/ContentSecurityPolicy/Reporting/Report.php+2 −2
- typo3/sysext/core/Classes/Security/ContentSecurityPolicy/Reporting/Resolution.php+1 −1
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97091-TSFE-clear_previewHasBeenRemoved.rst+1 −1
- typo3/sysext/core/Tests/Unit/Context/DateTimeAspectTest.php5+16 −0
- typo3/sysext/extensionmanager/Classes/Remote/TerExtensionRemote.php+1 −1
- typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php+7 −7
- typo3/sysext/frontend/Classes/Http/Application.php+6 −1
- typo3/sysext/frontend/Classes/Middleware/PreviewSimulator.php+1 −6
- typo3/sysext/install/Classes/Http/Application.php+1 −1
- typo3/sysext/install/Classes/Service/LanguagePackService.php+1 −1
- typo3/sysext/redirects/Classes/Repository/Demand.php+1 −3
- typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php3+3 −3
Review log 4257
Show 2232 earlier messages
-
Andreas Wolf uploaded patch set 1 11/23/23, 12:06
-
Mathias Brodala commented on patch set 1 11/23/23, 12:11
-
core-ci voted on patch set 1 V +1 11/23/23, 12:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49660
-
Andreas Wolf commented on patch set 1 11/23/23, 19:41
Application.php:75ReplyI thought so too, but that does not work when specifying a timestamp. -
Garvin Hicking commented on patch set 1 11/29/23, 14:32
DateTimeAspectTest.php:67Wouldn't this test also need a counterpart for actual timezones, so that a -x / +y offset return can be checked, by changing the current timezone and creating a new datetime object based off it? (I assume the testing framework just uses a 0-offset timezone by default?) -
Anja Leichsenring uploaded patch set 2
V +102/02/24, 10:00 -
Anja Leichsenring commented on patch set 2 CR +1 V +1 02/02/24, 10:01
DateTimeAspectTest.php:67Replylike this? -
Anja Leichsenring updated the commit message in patch set 3
CR +1V +102/02/24, 10:05 -
Anja Leichsenring voted on patch set 3 CR +1 V +1 02/02/24, 10:05
-
core-ci voted on patch set 2 V -1 02/02/24, 10:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52625
-
core-ci voted on patch set 3 V -1 02/02/24, 10:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52628
-
Garvin Hicking commented on patch set 3 02/02/24, 11:06
DateTimeAspectTest.php:67ReplyProbably, don't know the exact formatting here and what the TF uses by default. But also we should create tests with actual different offsets than 0 to verify behavior. -
Garvin Hicking commented on patch set 3 02/02/24, 11:07
DateTimeAspectTest.php:67ReplyAh sorry, didn't see the "+5" there already. Should do, but CI reports a "05" vs "5" issue. -
Anja Leichsenring commented on patch set 4
CR +1V +103/08/24, 08:59Published edit on patch set 3. -
core-ci voted on patch set 4 V -1 03/08/24, 09:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54211
-
Markus Klein commented on patch set 4 CR -1 03/29/24, 12:17
On it. There are quite a few more places to fix. moreover it seems cleaner to ``` (new DateTimeImmutable())->setTimestamp($ts) ``` because that uses the default timezone per definition -
Markus Klein uploaded patch set 5
CR -1V -103/29/24, 12:41 -
Markus Klein uploaded patch set 6 03/29/24, 12:43
-
core-ci voted on patch set 5 V -1 03/29/24, 12:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55062
-
core-ci voted on patch set 6 V -1 03/29/24, 12:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55063
-
Markus Klein uploaded patch set 7
V -103/29/24, 12:58 -
core-ci voted on patch set 7 V -1 03/29/24, 13:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55064
-
Markus Klein uploaded patch set 8
V -103/29/24, 13:08 -
Markus Klein commented on patch set 8 03/29/24, 13:10
DateTimeAspectTest.php:67ReplyDone -
core-ci voted on patch set 8 V +1 03/29/24, 13:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55065
-
Oliver Klee commented on patch set 8 03/30/24, 10:22
PreviewModule.php:244This code now does not look like it could throw an exception anymore. Maybe we can drop the try/catch and make the return type non-nullable. -
Markus Klein commented on patch set 8 04/01/24, 15:53
PreviewModule.php:244ReplyDone -
Markus Klein commented on patch set 9
V +104/01/24, 15:53Published edit on patch set 8. -
Markus Klein commented on patch set 10 04/01/24, 15:53
Published edit on patch set 9. -
core-ci voted on patch set 10 V +1 04/01/24, 15:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55117
-
core-ci voted on patch set 9 V -1 04/01/24, 16:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55116
-
Jan Delius voted on patch set 10 CR +1 V +1 04/03/24, 13:47
-
Oliver Klee voted on patch set 10 CR +1 V +1 04/03/24, 16:42
-
Stefan Bürk commented on patch set 10 CR -1 04/03/24, 19:43
tmp -1 -
Stefan Bürk commented on patch set 10 04/04/24, 13:06
TYPO3 v11 is in priority and security bugfix mode, and albeit this change is mostly cosmetic this may introduce a drastically change in output for a patch-level release (if one will happen again - there is no schedule for it). Not sure if that may raise some shitstorm - beside the fact it would be a legit bugfix. That means, that I would remove 11.5 from the releases list. Responsible project maintainers can still backport this bugfix manually and use composer patches to apply it on a TYPO3 v11 then. Literally, the same counts for TYPO3 v12, but as this is still in normal maintenance mode I'd would take it as bugfix for that version. Most places are context bound and pure display related, which is fine so far. In general I postulate, that we need kind of a concept on how to deal with date/time information in the future throughout the core: * storage/passing (ex. UTC only) vs context/timezone bound etc. * Formatting (context bound BE/FE - default php timezone / explicit timezone formatting * Formatting locale aware (IntlDateFormatter) and think about more configurable context (BE user timezone setting, FE user timezone setting) etc. A special remark, which should not be related to the touched places in this change, goes to dealing with persisting/reading datetime values to and from the database not using the unix-timestamp (integer value). If no timezone is provdided, `2012-01-02 19:00:12`, the database connection AND/OR datbase server default timezone also comes into play. The concecpt should also deal with the question about microtime (which make sense for logging and having MORE granual timings). In general, this change should be good for main and 12.4. Fine to limit it to these version ? See other comment, found a unrelated place which would make sense to tackle with this change also. NOTE: Mention the concept should not be taken as blocker for this change !!! I added it to emphasize that dealing with time/date/dateime formatings is a tricky topic and the reason it took quite some time to fully understand the impact of this change.MailMessage.php:94Not sure about that one ....SchedulerModuleController.php:750Unrelated - but `is_numeric()` is bogus here. That would allow to use exponent like strings. We should better use the `MathUtility::canBeInterpretatedAsInt()` method. What do you think ? Change it along the way ? -
Stefan Bürk voted on patch set 10 CR 0 04/04/24, 13:15
-
Markus Klein commented on patch set 10 04/04/24, 15:14
Reply
v11: I know that officially we are in that phase, but practice is that still a lot of projects have this as the current upgrade target, or no option to upgrade further due to missing v12 compatibility of extensions. We have to face reality here. I see no harm in showing the right time in Install Tool. I consider it a must-have to have a correct time in the Context. It is simply wrong to have diverging EXEC_TIME and Context-Time. > storage/passing (ex. UTC only) Is perfect for some cases, as catastrophe in others. But not to be discussed here. I fully agree that date/time is a nightmare in any kind. (I did a lot of fixing and streamlining in v7/v8 back then.)MailMessage.php:94ReplyAlso mails should not be from the future, if your current timezone is something < 0000.SchedulerModuleController.php:750ReplyYes, will adjust that too. -
Markus Klein commented on patch set 11
CR +1V +104/04/24, 15:16Published edit on patch set 10. -
core-ci voted on patch set 11 V -1 04/04/24, 15:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55339
-
Markus Klein commented on patch set 12
V -104/04/24, 19:02Published edit on patch set 11. -
core-ci voted on patch set 12 V +1 04/04/24, 19:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55343
-
Stefan Bürk commented on patch set 12 04/05/24, 11:21
MailMessage.php:94ReplyThis may hit only code adding it and directly reading&displaying it without proper transforming it from the DateTime timezone to the "to display Timezone" which is a consumer issue. But that's a concept thing again, not to be discussed here and now. For sending mails and symfony handling code this is safe to change. Let's do it.SchedulerModuleController.php:750ReplyDone -
Stefan Bürk updated the commit message in patch set 13
V +104/05/24, 11:40 -
core-ci voted on patch set 13 V +1 04/05/24, 11:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55381
-
Oliver Klee voted on patch set 13 CR +1 V +1 04/05/24, 11:55
-
Markus Klein updated the commit message in patch set 14
CR +1V +104/05/24, 12:30 -
core-ci voted on patch set 14 V +1 04/05/24, 12:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55382
-
Stefan Bürk voted on patch set 14 CR +1 V +1 04/05/24, 15:08
-
Garvin Hicking commented on patch set 14 CR +1 V +1 04/05/24, 21:22
This gets my head spinning, but it's looking good. Probably better wait for the next 12.x release a few days before a 11.x release with this is made, just as extra precaution for side effects? -
Andreas Wolf commented on patch set 15
CR +1V +104/06/24, 09:13Published edit on patch set 14. -
Andreas Wolf commented on patch set 15 CR +1 04/06/24, 09:15
I created the initial patchset, but there were so many additional changes that it's enough to justify me voting on it. -
core-ci voted on patch set 15 V +1 04/06/24, 09:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55433
-
Garvin Hicking voted on patch set 15 CR +1 V +1 04/06/24, 10:23
-
Stefan Bürk commented on patch set 15 04/06/24, 11:09
Going to merge this when I'm back at home ... enjoying the sun today ;) -
Oliver Klee voted on patch set 15 CR +1 V +1 04/07/24, 08:03
-
Stefan Bürk voted on patch set 15 CR +2 V +2 04/07/24, 08:15
-
Stefan Bürk merged patch set 16 04/07/24, 09:49
Application.php:75