Project

General

Profile

Actions

Bug #89022

open

TCA eval => 'date' sometimes fails with error

Added by Georg Tiefenbrunn over 4 years ago. Updated 10 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2019-08-27
Due date:
% Done:

100%

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

Description

Looking into the error log I stumbled upon the following error:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: DateTime::__construct(): Failed to parse time string (1566777600) at position 8 (0): Unexpected character | Exception thrown in file .../typo3/sysext/core/Classes/DataHandling/DataHandler.php in line 1904.

I can't reproduce the error in BE :( The request indicates that the error occurs when saving new records.

// TCA definition
'config' => [
    'type' => 'input',
    'renderType' => 'inputDateTime',
    'dbType' => 'date',
    'eval' => 'date',
    'size' => 10,
    'default' => null,
]

TYPO3\CMS\Core\DataHandling\DataHandler::checkValueForInput()

9.5 https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L1904
10 https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L1738

$dateTime = new \DateTime($value);

Under conditions I can't reproduce $value passed to \DateTime() is an integer (see error above: 1566777600 = 2019-08-26T00:00:00+00:00).


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #101278: Fix incorrect DateTimeTest method namesResolvedBenjamin Franzke2023-07-06

Actions
Actions

Also available in: Atom PDF