66904[BUGFIX] Allow 1970-01-01 as native datetime input
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Markus Klein +1
-
Verified V +2 Done
- Benni Mack +2
- Markus Klein +1
- core-ci +1 CI
Issues 1
Files 4
Review log 4769
Show 3144 earlier messages
-
Imko Schumacher uploaded patch set 1 11/25/20, 17:59
-
TYPO3com voted on patch set 1 V +1 11/25/20, 18:11 Completed build in 11m 55s on Wed, 25 Nov, 06:11 PM Test Summary: 32406 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7580
-
Imko Schumacher commented on patch set 1 11/25/20, 18:26
Note: Discussion started in https://review.typo3.org/c/Packages/TYPO3.CMS/+/66670/DataHandler.php:1705@Sascha Egerer Could you give a example case, where this check is required? -
Markus Klein commented on patch set 1 11/27/20, 21:16
What do you mean by this? native datetime fields have to allow "null" and still a default time can be specified in TCA -
Imko Schumacher commented on patch set 1 11/27/20, 21:52
Reply
With that I mean the added comparison in checkValue_input_Eval. This is only inside checkValueForInput relevant. If $value starts with the default time (00:00:00), the $value gets set to null in Line 1685. Without this check, inside checkValue_input_Eval would set the value to the current timestamp (new DateTime(null) = current date), resulting the output to be the current time !== default time. This is covered by the "Default time" test. -
Imko Schumacher uploaded patch set 2 11/30/20, 17:29
-
Imko Schumacher updated the commit message in patch set 3 11/30/20, 17:35
-
TYPO3com voted on patch set 2 V +1 11/30/20, 17:41 Completed build in 12m 10s on Mon, 30 Nov, 05:41 PM Test Summary: 32416 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7710
-
TYPO3com voted on patch set 3 V +1 11/30/20, 17:47 Completed build in 11m 45s on Mon, 30 Nov, 05:47 PM Test Summary: 32416 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7711
-
Markus Klein uploaded patch set 4 01/05/21, 23:12
-
TYPO3com voted on patch set 4 V +1 01/05/21, 23:25 Completed build in 12m 19s on Tue, 5 Jan, 11:25 PM Test Summary: 32569 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8662
-
Benni Mack updated the commit message in patch set 5 10/20/21, 15:35
-
Benni Mack uploaded patch set 6 10/20/21, 15:45
-
core-ci voted on patch set 6 V +1 10/20/21, 15:59 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18387
-
Markus Klein voted on patch set 6 CR +1 10/20/21, 20:39
-
Benni Mack updated the commit message in patch set 7 11/18/21, 10:43
-
core-ci voted on patch set 7 V +1 11/18/21, 12:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19457
-
Benni Mack wrote 11/29/21, 10:18
Change destination moved from master to main -
Benni Mack updated the commit message in patch set 8 11/29/21, 14:07
-
core-ci voted on patch set 8 V +1 11/29/21, 16:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20095
-
Simon Schaufelberger commented on patch set 8 V -1 CR -1 07/07/22, 01:55
Imko, this needs a total rework because the DataHandler has totally changed in the meantime. Could you please take care of it? -
Imko Schumacher marked it work in progress 07/07/22, 18:41
-
Imko Schumacher uploaded patch set 9
CR -1V +112/11/22, 16:50 -
Imko Schumacher marked it ready for review 12/11/22, 16:51
-
Imko Schumacher commented on patch set 9 12/11/22, 16:52
DataHandler.php:1705ReplyDone -
core-ci voted on patch set 9 V +1 12/11/22, 16:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34882
-
Markus Klein updated the commit message in patch set 10
V +101/10/23, 08:13 -
core-ci voted on patch set 10 V -1 01/10/23, 08:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35631
-
Stefan Bürk rebased onto patch set 11
V -101/10/23, 20:50 -
core-ci voted on patch set 11 V +1 01/10/23, 20:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35659
-
Markus Klein commented on patch set 11 03/20/23, 08:56
Now that you write this so explicitly, it comes to my mind how crazy this actually is. The range of native datetime is much larger than timestamps, so this is actually totally broken by design already. :-(And this default "0000-00...." is actually invalid according to SQL specs.Reply
Done -
Imko Schumacher commented on patch set 11 03/20/23, 19:00
Reply
That is correct (when limited to 32 bit). However, since most systems today are 64bit it does not matter too much. Any reasonable date can be processed.Reply
Actually it is valid in MySQL (see https://dev.mysql.com/doc/refman/8.0/en/date-and-time-types.html), but probably not supported by most other DBs. So I thing we should not set this 'special value' in line #2138, but rather set is to null or '00:00:00' (for time values, since midnight is a common case). -
Imko Schumacher uploaded patch set 12
V +103/20/23, 19:19 -
core-ci voted on patch set 12 V -1 03/20/23, 19:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39271
-
Markus Klein commented on patch set 12 03/20/23, 19:53
Reply
I had https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_no_zero_date in mind. It is enabled by default, hence you either get warnings or you fail hard depending on the strict-mode. -
Imko Schumacher uploaded patch set 13
V -103/20/23, 20:22 -
core-ci voted on patch set 13 V +1 03/20/23, 20:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39275
-
Imko Schumacher commented on patch set 13 03/20/23, 20:35
Reply
That is right. I adapted it in patchset 12, so that the default value (0000-00-00 00:00:00) is not set in this function anymore. Instead null (date, datetime) or 00:00:00 (time) is used. -
JAKOTA Design Group GmbH commented on patch set 13 03/20/23, 22:19
DataHandler.php:2138What about nullable time fields? Where null is not set and 00:00:00 is not empty but midnight? -
JAKOTA Design Group GmbH commented on patch set 13 03/20/23, 23:22
DataHandler.php:2138Replythis should be checked like this: if ($isNativeDateTimeField) { if (($tcaFieldConf['nullable'] ?? false) === true) { // Convert the timestamp back to a date/time if not null $res['value'] = $res['value'] !== null ? gmdate($nativeDateTimeFieldFormat, $res['value']) : null; } else { // Convert the timestamp back to a date/time $res['value'] = $res['value'] !== null ? gmdate($nativeDateTimeFieldFormat, $res['value']) : $nativeDateTimeFieldResetValue; } } else { -
JAKOTA Design Group GmbH uploaded patch set 14
V +103/21/23, 10:04 -
JAKOTA Design Group GmbH commented on patch set 14 03/21/23, 10:17
DataHandler.php:2138ReplyI've added this check and extended the unit test for this edge case too. -
core-ci voted on patch set 14 V +1 03/21/23, 10:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39308
-
Benni Mack updated the commit message in patch set 15
V +105/03/23, 09:38
-
Benni Mack uploaded patch set 16 07/04/23, 20:24
-
core-ci voted on patch set 16 V -1 07/04/23, 20:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43437
-
JAKOTA Design Group GmbH uploaded patch set 17
V -107/05/23, 15:21 -
core-ci voted on patch set 17 V -1 07/05/23, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43544
-
JAKOTA Design Group GmbH commented on patch set 17 07/05/23, 15:47
Hi, I've fixed the previous pipeline error. But the new one seems unrelated to this patch. Does anyone know how to proceed? -
Benni Mack rebased onto patch set 18
V -107/05/23, 17:33 -
core-ci voted on patch set 18 V +1 07/05/23, 17:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43571
-
Benni Mack commented on patch set 18 07/05/23, 19:02
Reply
Done -
Benni Mack rebased onto patch set 19
V +107/05/23, 19:18 -
Benni Mack uploaded patch set 20 07/05/23, 19:21
-
core-ci voted on patch set 19 V -1 07/05/23, 19:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43604
-
Benni Mack uploaded patch set 21 07/05/23, 19:45
-
core-ci voted on patch set 20 V -1 07/05/23, 19:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43606
-
core-ci voted on patch set 21 V +1 07/05/23, 19:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43611
-
Benni Mack commented on patch set 21 CR -1 07/05/23, 20:00
As much as this is good, when I test this in FormEngine, the FormEngine JS always removes my selected value of 01-01-1970. Once we have solved this (separate or in the same patch), this patch is good to go. -
Benni Mack commented on patch set 22
CR -1V +107/05/23, 20:42Published edit on patch set 21. -
Markus Klein commented on patch set 23 07/05/23, 20:57
Published edit on patch set 22. -
Markus Klein uploaded patch set 24 07/05/23, 21:00
-
core-ci voted on patch set 22 V +1 07/05/23, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43623
-
core-ci voted on patch set 24 V +1 07/05/23, 21:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43633
-
core-ci voted on patch set 23 V -1 07/05/23, 21:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43630
-
Benni Mack voted on patch set 24 V +1 CR +1 07/06/23, 07:37
-
Markus Klein voted on patch set 24 V +1 CR +1 07/06/23, 11:27
-
Benni Mack voted on patch set 24 V +2 CR +2 07/06/23, 11:28
-
Benni Mack merged patch set 25 07/06/23, 11:28