82093[BUGFIX] Fix initialization of 00:00 time input
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Garvin Hicking +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 2
Review log 3040
Show 1015 earlier messages
-
Imko Schumacher uploaded patch set 1 12/05/23, 19:23
-
core-ci voted on patch set 1 V +1 12/05/23, 19:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50394
-
Garvin Hicking commented on patch set 1 V +1 12/06/23, 08:12
Very nice catch! Tried the patch and indeed it works. This issue existed for ages, odd that it wasn't addressed yet :-O Would you be able to add Tests for that specific scenario, to get a test that fails on the current setup and succeeds with your patch applied? (Something along the lines of https://review.typo3.org/c/Packages/TYPO3.CMS/+/81645/13/typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsEmptyElementsCest.php - don't know if it's possible to test it with a functional test like for DataHandler) -
Imko Schumacher commented on patch set 1 12/17/23, 16:58
Reply
I currently don't have the capacity to provide a functional tests. -
Garvin Hicking commented on patch set 1 12/17/23, 17:09
Reply
Thanks for the response. I'll try to add one and add it to your patch here. -
Benni Mack updated the commit message in patch set 2
V +101/08/24, 20:11 -
core-ci voted on patch set 2 V +1 01/08/24, 20:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51285
-
Garvin Hicking commented on patch set 2 01/08/24, 20:18
(Note: I still have it on my radar, but will probably only find time at the end of the month to work on it. If anyone else wants to add a test before that, please go ahead - but I think we should add it to prevent future regressions with this) -
Garvin Hicking uploaded patch set 3
V +104/05/24, 15:30Add test -
core-ci voted on patch set 3 V -1 04/05/24, 15:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55392
-
Garvin Hicking commented on patch set 3 04/05/24, 15:37
Hhm. Just after I submitted this, I saw a problem that tunnelvision hid from me. The problem is now (and already before) that we cannot discern a "00:00" entered timestamp from a "0" stored empty timestamp. Previously, this was interpreted as "yup, this is not set". With this fix, s aved value (!) is interpreted as "hey, 0 is actually 01.01.1970 00:00 and a set value". So, for a stored record with a "0" in a timestamp field, it will now be displayed as "00:00" and not "(empty)". For a "fresh" unsaved record without data retrieval from the database, the fields will properly be uninitialized. I suppose one could be able to use a NULLable field and set a time to NULL then, but this could be interpreted as a breaking change, if that would be required. On the other hand, the current situation can be considered a bug, because you will "lose data" when editing a record you intentionally saved with a "00:00" timestamp, if validation/required fields are utilized. -
Garvin Hicking uploaded patch set 4
V -104/05/24, 15:38cgl -
core-ci voted on patch set 4 V -1 04/05/24, 15:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55393
-
core-ci voted on patch set 4 V +1 04/05/24, 15:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55393
-
Garvin Hicking commented on patch set 4 04/05/24, 16:57
Reply
Note to next-week future me: That thought about NULLing could be a way. Make required fields nullable, so that only only for these fields the "00:00" value is stored when (int)$value === 0. Because on those fields we can differ between 0 (00:00) and NULL (no value yet). Question is only if we can fetch db stored value and differ between NULL and 0, or if its too late for that by then. That way wouldn't break BC arguably, and could still allow "require" a set field. For non nullable fields reverting from "00:00" to "" (0) should both result in being able to save and retrieve "0". People affected by this would need to change their fields to being nullable, but I think that's fair and understandable if one thinks about it? So, future Garvin: Test if this does work, or if NULLing timefields opens another can of worms.
-
Garvin Hicking uploaded patch set 5
V +104/08/24, 09:29Evaluate nullable -
Garvin Hicking commented on patch set 5 04/08/24, 09:30
Hi all and me. I think with "NULLABLE" this works well enough. Not sure if an Important RST might be needed. -
core-ci voted on patch set 5 V +1 04/08/24, 09:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55548
-
Garvin Hicking commented on patch set 5 CR +1 V +1 04/08/24, 11:24
Reply
Done -
Andreas Kienast voted on patch set 5 CR +1 04/08/24, 11:46
-
Andreas Kienast uploaded patch set 6
CR +1V +104/08/24, 11:51 -
core-ci voted on patch set 6 V +1 04/08/24, 11:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55557
-
Andreas Kienast voted on patch set 6 CR +1 V +1 04/08/24, 11:56
-
Garvin Hicking voted on patch set 6 CR +1 V +1 04/10/24, 11:46
-
Jörg Bösche voted on patch set 6 CR +1 04/11/24, 12:56
-
Benjamin Franzke commented on patch set 6 04/23/24, 06:33
DatetimeElement.php:187This condition is hard to understand. We actually mean: ``` if ( (int)$itemValue > 0 || ((int)$itemValue === 0 && $config['nullable'] ?? false) ) { … } ``` I know that the current condition is more optimized, but I think it is important to express the intend of the business logic. Optimization will be done by PHP anyway.DatetimeElement.php:191caseDatetimeElement.php:192orDatetimeElement.php:193casted -
Garvin Hicking uploaded patch set 7
CR +1V +104/23/24, 10:19Better condition readability -
Garvin Hicking commented on patch set 6 CR +1 V +1 04/23/24, 10:22
DatetimeElement.php:187ReplyThanks. This is a good improvement! I adjusted it to !== 0 and not just > 0 because I'm actually not sure if negative integers should also trigger this properly...DatetimeElement.php:191ReplyDoneDatetimeElement.php:192ReplyDoneDatetimeElement.php:193Reply"cast" is an irregular verb and thus the past participle form is more commonly used as "cast" instead of "casted", so even though "casted" isn't wrong, it's a much less commonly used form, if that's ok with you to keep 😊 -
core-ci voted on patch set 7 V -1 04/23/24, 10:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56561
-
Garvin Hicking uploaded patch set 8
V -104/23/24, 10:26Missing braces -
core-ci voted on patch set 8 V +1 04/23/24, 10:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56562
-
Garvin Hicking voted on patch set 8 CR +1 V +1 04/25/24, 07:45
-
Simon Schaufelberger voted on patch set 8 CR +1 05/16/24, 09:22
-
Benjamin Franzke uploaded patch set 9
CR +1V +106/03/24, 06:18 -
Benjamin Franzke commented on patch set 9 06/03/24, 06:18
DatetimeElement.php:193Replyack, lets write "casts to int", "be" still feels odd here. -
Benjamin Franzke voted on patch set 9 V +1 06/03/24, 06:20
-
core-ci voted on patch set 9 V +1 06/03/24, 06:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58607
-
Garvin Hicking commented on patch set 9 CR +1 V +1 06/03/24, 06:32
DatetimeElement.php:193ReplyThanks for the rework, that's better! :) -
Benjamin Franzke voted on patch set 9 CR +2 V +2 06/03/24, 07:47
-
Benjamin Franzke merged patch set 10 06/03/24, 07:54