Issue Bug Closed

#72654Date and Datetime cause error at page copy

Michael Fritz 01/12/16, 15:46 updated 10/02/18, 11:19

Description

When I copy a page, I got an error from the typo3_src-6.2.17/typo3/sysext/core/Classes/DataHandling/DataHandler.php telling me, getTimestamp causes an error.

This is somehow, because the $dateTime here has the value FALSE, but it should have at least the value 0000-00-00.

Problem Line ~1729: $value = $value = $emptyValue: $dateTime->getTimestamp();
Fix: $value = $value = $emptyValue || $dateTime === false ? 0 : $dateTime->getTimestamp();

This might be due to a customised TCA in my table PAGES using DATE as a database field.

“tx_mask_eventstart”: {
“config”: {
“type”: “input”,
“dbType”: “date”,
“size”: “8”,
“max”: “20”,
“eval”: “date“
},
“key”: “eventstart”,
“l10n_mode”: “exclude“
},

Reviews 3