[TYPO3-core] RFC: Bug 5956: TCA eval required on date field does not work
Oliver Hader
oh at inpublica.de
Tue Aug 21 08:56:15 CEST 2007
Hi Wolfgang,
Wolfgang Klinger schrieb:
> On Aug 7, 2007, at 3:10 PM, Oliver Hader wrote:
>> 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"
>
> Looks ok to me,
> though what I don't understand by reading the patch is why you changed
> these lines:
>
> Index: t3lib/jsfunc.evalfield.js
> ===================================================================
> --- t3lib/jsfunc.evalfield.js (Revision 2438)
> +++ t3lib/jsfunc.evalfield.js (Arbeitskopie)
> @@ -77,7 +77,9 @@
> var theEvalType = this.split(evallist, ",", index);
> var newValue=value;
> while (theEvalType) {
> - newValue = evalFunc.output(theEvalType, value, FObj);
> + if (theEvalType != 'required') {
> + newValue = evalFunc.output(theEvalType, value, FObj);
> + }
> index++;
> theEvalType = this.split(evallist, ",", index);
> }
jsfunc.evalfunc.js does only conversions, e.g. from unixtime to a human
readable format. Keys in the TCA property "eval" which are not defined
in jsunc.evalfunc.js to do anything, like 'required', just return the
raw value. This causes that using 'eval' => 'date,required' shows the
unixtimestamp (the raw value) again.
olly
--
Oliver Hader
http://inpublica.de/
More information about the TYPO3-team-core
mailing list