Bug #65496
closeddbType datetime not working when using manual table mapping
0%
Description
Write to table is not working, because Extbase tries to save Unix-Timestamp instead of format '0000-00-00 00:00:00'.
Also the property is empty when reading.
mySQL-Database with native Datetime-Field.
TCA, Model etc. was created with Extension Builder. When I use the created table instead of custom_table (without mapping),
everything works fine. So there seems to be a difference when using table-mapping.
custom_field datetime DEFAULT '0000-00-00 00:00:00',
TCA:
'custom_field' => array( 'exclude' => 1, 'label' => 'Datum', 'config' => array( 'dbType' => 'datetime', 'type' => 'input', 'size' => 12, 'eval' => 'datetime', 'checkbox' => 0, 'default' => '0000-00-00 00:00:00' ), ),
Typoscript-Mapping:
MyVendor\MyExt\Domain\Model\Nachricht { mapping { tableName = custom_table columns { custom_field.mapOnProperty = antwortDatum } } }
Model:
/** * antwortDatum * * @var \DateTime */ protected $antwortDatum = NULL;
Updated by Daniel Goerz over 8 years ago
- Status changed from New to Closed
Hello,
I am closing this ticket because the behavior you describe is not a bug in TYPO3. If you specify an alternative table for your model, make sure the TCA of the new table is there to configure the fields. If you don't configure the custom_field
of custom_table
to be of type dateTime
in TCA there is no way the DataMapper could know hot to handle the input.
I tested your scenario with a custom_table and as soon as I add the according TCA for custom_table
everything works as expected.
If you however still think this is a bug in the TYPO3 core, feel free to reopen the ticket or file a new bug report.