Bug #18248
closedEmpty datetime and other timestamp fields with displayCond = defaultAsReadonly
0%
Description
On Localization a empty datetime field will be displayed as "01:00 01-01-1970" if a display condition is set to defaultAsReadonly in the tca.php of a extension.
This can be fixed by a modifikation of the function getSingleField_typeInput in class.t3lib_tceforms.php.
Change the code at the beginning from:
if($this->renderReadonly || $config['readOnly']) {
$itemFormElValue = $PA['itemFormElValue'];
if (in_array('date',$evalList)) {
$config['format'] = 'date';
} elseif (in_array('date',$evalList)) {
$config['format'] = 'date';
} elseif (in_array('datetime',$evalList)) {
$config['format'] = 'datetime';
} elseif (in_array('time',$evalList)) {
$config['format'] = 'time';
}
if (in_array('password',$evalList)) {
$itemFormElValue = $itemFormElValue ? '*********' : '';
}
return $this->getSingleField_typeNone_render($config, $itemFormElValue);
}
to this:
if($this->renderReadonly || $config['readOnly']) {
$itemFormElValue = $PA['itemFormElValue'];
if (in_array('date',$evalList)) {
if( intval($itemFormElValue) == 0 ) {
$itemFormElValue = '';
} else {
$config['format'] = 'date';
}
//} elseif (in_array('date',$evalList)) {
// $config['format'] = 'date';
} elseif (in_array('datetime',$evalList)) {
if( intval($itemFormElValue) == 0 ) {
$itemFormElValue = '';
} else {
$config['format'] = 'datetime';
}
} elseif (in_array('time',$evalList)) {
$config['format'] = 'time';
}
if (in_array('password',$evalList)) {
$itemFormElValue = $itemFormElValue ? '*********' : '';
}
return $this->getSingleField_typeNone_render($config, $itemFormElValue);
}
This corrects the display for date and datetime fields on localization. Also the duplicate check for date fields is out commented.
(issue imported from #M7586)
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
- Is Regression set to No
No feedback for over 90 days.
Updated by This Mächler over 9 years ago
I have the same issue with TYPO3 6.2.9.
For other field types like string it works: I have a title(varchar) and a date_time(datetime), both configured in TCA with
'l10n_mode' => 'exclude', 'l10n_display' => 'defaultAsReadonly',
The localized records all have empty / NULL values in the columns title and date_time in the DB.
For the title all works as intended, the overlay works both in backend list/show and also in the Extbase-frontend.
- In the backend record list, the date_time is taken form the original language record and shown when I add it to the 'label_alt' ctrl. But if I add a the column 'date_time' to the list, there it is not shown (same for the title).
- In the record edit form in the TYPO3-backend, the value '01:33 01-01-1970' is shown (???)
- In the exbase frontend, the value is returned as intended, but sorting by it only works in the original language..