[TYPO3-core] RFC: Bug 5956: TCA eval required on date field does not work

Oliver Hader oh at inpublica.de
Tue Aug 7 15:10:14 CEST 2007


This is a SVN patch request.

Problem:
Defining a date/datetime field to be required via $TCA lead to errors:
* Instead of showing the date like "2007-08-07" the timestamp was shown
* If the date field is empty the field isn't marked as "requiered"

Solution:
In jsfunc.evalfield.js the defined eval types are checked concerning the
given value. If an type was not defined there, like 'required', it's
just returning the raw value and for date fields, this is the timestamp.
So, just prevent the eval type 'required' from doing anything in
jsfunc.evalfield.js.
Empty date fields are not marked es required because the default value
of these fields is mostly "0". Since this is seen as string, TBE_EDITOR
returns a true value on a check. The solution is to send an additional
flag 'isDateTime' in t3lib_TCEforms to TBE_EDITOR. If it's set,
TBE_EDITOR knows, that the string "0" is a blank value in this case.

Bugtracker references:
http://bugs.typo3.org/view.php?id=5956

Branches: TYPO3_4-1 & Trunk


olly
-- 
Oliver Hader
http://inpublica.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005956_v2.patch
Type: text/x-patch
Size: 5717 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070807/7739b671/attachment.bin 


More information about the TYPO3-team-core mailing list