Project

General

Profile

Actions

Bug #105550

closed

(pseudo) Native dbType=datetime strings in flexforms not working and interpreted as integer

Added by Benjamin Franzke 15 days ago. Updated 1 day ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Start date:
2024-11-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

With dbType=datetime in a flexform:

https://github.com/TYPO3/typo3/blob/3343d780e6438a8de02494717fb5761e461f65b9/typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_basic.php#L1703-L1710

<inputDateTime_4>
    <label>inputDateTime_4 dbType=datetime format=date</label>
    <config>
        <type>datetime</type>
        <format>date</format>
        <dbType>datetime</dbType>
    </config>
</inputDateTime_4>

The value is interpreted as integer instead of as a string because the DatabaseRowDateTimeFields is only applied to real columns and not to flexform columns.

Which then results in flexform dbType datetime's to be interpreted as integers by:
https://github.com/TYPO3/typo3/blob/3343d780e6438a8de02494717fb5761e461f65b9/Build/Sources/TypeScript/backend/form-engine-validation.ts#L156

Therefore a database value like 1960-01-01 05:42:23 is interpreted as 1960 seconds (unix timestamp) which results in a fake-date to be calculated: 1970-01-01T00:32:40Z (32:40 because 1960 = 32 * 60 + 40)

As a result the date is 1970 instead of 1960 as shown below:


Files

Actions #1

Updated by Gerrit Code Review 15 days ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86912

Actions #2

Updated by Gerrit Code Review 15 days ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86912

Actions #3

Updated by Gerrit Code Review 15 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86912

Actions #4

Updated by Gerrit Code Review 15 days ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86912

Actions #5

Updated by Gerrit Code Review 15 days ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86912

Actions #6

Updated by Gerrit Code Review 1 day ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87067

Actions #7

Updated by Gerrit Code Review 1 day ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87068

Actions #8

Updated by Benjamin Franzke 1 day ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF