Project

General

Profile

Bug #81043

Updated by Cihan Yesilöz almost 7 years ago

TCA of type "select" leads to an exception when used with MySQL-strict-mode "STRICT_TRANS_TABLES". 

 *TCA-configuration*: 
 <pre> 
         'status' => [ 
             'exclude' => 1, 
             'label' => 'Status', 
             'config' => array( 
                 'type' => 'select', 
                 'renderType' => 'selectSingle', 
                 'items' => ( Status( 
                     array('Level-1', 1), 
                     array('Status-2', 2), 
                     array('Status-3', 3) 
                 ), 
                 'default' => 1, 
             ), 
         ], 
 </pre> 

 *PHP-Code*: 
 <pre> 
 <?php 
         $newUser = new User(); 
         $newUser->setStatus(1); 
         $userRepository = $this->objectManager->get(UserRepository::class); 
         $userRepository->add($newUser); 
         $persistenceManager = $this->objectManager->get(PersistenceManager::class); 
         $persistenceManager->persistAll(); 
 ?> 
 </pre> 

 *The exception thrown by TYPO3*: 
 <pre> 
 #1470230766: Incorrect integer value: '' for column 'status' at row 1 (More information) 
 </pre> 

 When I revert the change in "typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php" in Line 335 in Commit https://github.com/TYPO3/TYPO3.CMS/commit/38a1bc5dd7990b63e45c0419065cd02fe91187e9#diff-a8aa95385a4a9a2e39c52f857dbc0e28 the error disappears. The error also disappears when I disable the sql strict mode "STRICT_TRANS_TABLES"  

Back