Project

General

Profile

Actions

Bug #18248

closed

Empty datetime and other timestamp fields with displayCond = defaultAsReadonly

Added by Juergen Deisenroth about 16 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-02-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #21602: Value Preview of empty timestamp shows "01-01-70 (-40 yrs) "Closed2009-11-18

Actions
Actions

Also available in: Atom PDF