Review main Merged

86912[BUGFIX] Add FormEngine transformation for dbType=datetime in flexforms

Benjamin Franzke CR +2 V +2 Normal +102 −67 updated 11/19/24, 19:44

Commit message

The database-to-backend-from transformation for dbType=datetime fields
(which are supposed to be stored in native databse DATETIME fields,
but are stored as datetime strings in flexforms) were not configured.
As a consequence the raw value (not an ISO8601 string, but Date + Time
separated by a space-char) was passed into formengine and incorrectly
interpreted as timestamp, because it failed to be parsed as a ISO8601
date.

Add this configuration and remove the previously erroneously used
timestamp parsing which is no longer needed since #104309 and was
only implicitly used to transform the datetime, which hid
this bug by resolving into an incorrectly created date.
For this invalid case we'll now throw an error instead of hiding
this case with an invalid transformation.

Note that this cleanup is related to #104309, but the issue has
been present before. Prior to #104309 the field was rendered
as "Invalid DateTime", while the switch to ISO8601 in #104309
resulted in an invalid date to be generated:
A flexform value like "1960-01-01 05:42:23" was interpreted as 1960
seconds (unix timestamp) after 1970 which results in a fake-date to be
calculated: 1970-01-01T00:32:40Z (32:40 because 1960s = 32 * 60 + 40).

Review

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

Issues 2

Files 5

Review log 1116

  1. Benjamin Franzke uploaded patch set 1 11/06/24, 15:49

  2. core-ci voted on patch set 1 V -1 11/06/24, 15:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69146

  3. Benjamin Franzke uploaded patch set 2 V -1 11/06/24, 16:07

  4. Benjamin Franzke uploaded patch set 3 11/06/24, 16:13

  5. core-ci voted on patch set 2 V -1 11/06/24, 16:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69148

  6. core-ci voted on patch set 3 V -1 11/06/24, 16:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69149

  7. Benjamin Franzke uploaded patch set 4 V -1 11/06/24, 16:31

  8. core-ci voted on patch set 4 V -1 11/06/24, 16:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69150

  9. Benjamin Franzke uploaded patch set 5 V -1 11/06/24, 17:04

  10. core-ci voted on patch set 5 V +1 11/06/24, 17:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69153

  11. Andreas Kienast voted on patch set 5 CR +1 V +1 11/07/24, 12:24

  12. Benni Mack voted on patch set 5 CR +1 V +1 11/15/24, 21:34

  13. Benjamin Franzke commented on patch set 5 CR -1 11/18/24, 10:36

    DefaultConfiguration.php:838

    @lolli@schwarzbu.ch would love to head a +1 or -1 on this specific aspect from your side. Maybe you have some edge cases in mind which we could oversee.
  14. Christian Kuhn commented on patch set 5 11/19/24, 17:55

    DefaultConfiguration.php:838 Reply

    This feels good. I suppose not adding this DP to the flex group was an oversight.
  15. Benjamin Franzke commented on patch set 5 CR +2 V +2 11/19/24, 19:40

    DefaultConfiguration.php:838 Reply

    Thx, also manually verified different cases in the explicit elements_flex test as you suggested in private – no intent to merge that right now (to much chaos, and would rather require general testing of the _flex case), but pushed & abandoned immediately: > 87066: [WIP][TASK] Test input datetime in flex | https://review.typo3.org/c/Packages/TYPO3.CMS/+/87066
  16. Benjamin Franzke merged patch set 6 11/19/24, 19:44