Project

General

Profile

Actions

Bug #18248

closed

Empty datetime and other timestamp fields with displayCond = defaultAsReadonly

Added by Juergen Deisenroth almost 17 years ago. Updated over 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 #1

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)?

Actions #2

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.

Actions #3

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.

But for date_time the following strange behaviour occurs:
  • 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..
Actions

Also available in: Atom PDF