[TYPO3-core] RFC: Bug #4515: Date fields displayed wrong in TCEforms

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Nov 15 14:15:53 CET 2006


Martin Kutschker schrieb:
> Ernesto Baschny [cron IT] schrieb:
>> Michael Stucki schrieb:
>>
>>> This is a SVN patch request.
>>>
>>> Problem:
>>> Input fields with TCA setting "eval" => "date" and "readOnly" => 1
>>> will display a wrong date if they are empty.
> 
> I only noticed now that the bug description is wrong. ... or the
> solution.

The description and the solution to the bug is clearly ok, as I was able
to reproduce it. You can try with tt_news. Just set the archiveDate
field to "readOnly => 1" in tca.php and then edit a tt_news record that
has not archiveDate set. The date displayed will be 1-1-1970 without the
patch and nothing with the patch.

Also consider my modification to cover also the other "date" related
fields, which also have the same problem.

> The code you have changed is only executed for fields of type
> "none" with the "format" option set.

I could not understand what you mean, or maybe you are wrong. The
changed code is executed on fields with eval set to 'date' in the
readOnly case (where you don't render an input box, but the text "as is").

You can test it with the archivedate field of tt_news, that is
configured as:

        'archivedate' => Array (
            'l10n_mode' => 'mergeIfNotBlank',
            'exclude' => 1,
            'label' =>
'LLL:EXT:tt_news/locallang_tca.php:tt_news.archivedate',
            'config' => Array (
                'type' => 'input',
                'size' => '10',
                'max' => '20',
                'eval' => 'date',
                'default' => '0',
            )
        ),

Add a readOnly => 1 in the config.


Cheers,
Ernesto



More information about the TYPO3-team-core mailing list