Project

General

Profile

Bug #79304

Updated by Sascha Egerer over 7 years ago

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

 Example configuration (from styleguide extension) 
 <pre> 
         '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' 
             ], 
         ], 
 </pre> 

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

 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

Back