Project

General

Profile

Actions

Bug #79304

closed

Epic #77562: Misbehaviors with datetime values and timezones

SQL error if empty datetime value is saved

Added by Sascha Egerer over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
-
Target version:
Start date:
2017-01-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

Description

If a TCA input field of dbType datetime is saved with an empty value a SQL error is triggered.

1: These fields of record 1 in table "tx_datetimetest_domain_model_history" have not been saved correctly: date_time_native! The values might have changed due to type casting of the database.

Example configuration (from styleguide extension)

        'input_37' => [
            'exclude' => 1,
            'label' => 'input_37 dbType=datetime eval=datetime',
            'config' => [
                'dbType' => 'datetime',
                'type' => 'input',
                'size' => 20,
                'eval' => 'datetime',
                'checkbox' => 0,
                'default' => '0000-00-00 00:00:00'
            ],
        ],

2: SQL error: 'Incorrect datetime value: '0' for column 'input_37' at row 1' (tx_styleguide_elements_basic:1)

This can be reproduced with the Acceptance tests
./bin/codecept run -f Acceptance -c components/testing_framework/core/Build/AcceptanceTests.yml typo3/sysext/core/Tests/Acceptance/Backend/Formhandler/ElementsBasicCest.php:checkThatValidationWorks_EvalDateTime_DbTypeDateTime

They (sometimes) are successfull but the sql error message is visible for a short time


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #81548: TCA empty input with renderType => inputDateTime with dbType => date gives error on saveClosed2017-06-12

Actions
Actions

Also available in: Atom PDF