[TYPO3-mvc] Validation in TCA and extbase

Jochen Rau jochen.rau at typoplanet.de
Tue Oct 13 17:52:12 CEST 2009


Hi Jigal.

Jigal van Hemert wrote:
> Jochen Rau wrote:
>> The developer has to keep the validation rules in $TCA 'compatible' to
>> those defined by @validate. Let's assume we have a property defined
>> with "@validate NotEmpty" and forgot to add "'eval' => 'required'" to
>> the $TCA. In this case, leaving the field in BE empty will result in
>> an unvalid Object.
>
> This is unfortunately not always possible. There is no 'eval' => 'email'
> AFAIK and maybe some 'eval' validation options are not (yet) available
> in extbase (FLOW3).

Yes. Unfortunately the validation rules TCA<->Extbase<->FLOW3 are not in 
sync. While it is no problem to be in sync with Extbase<->FLOW3. It will 
be really challenging to sync TCA<->Extbase. AFAIK there is also 
JavaScript stuff to consider.

> I'll see if I can compile a list of validators for TCA and extbase. I am
> willing to make a patch for the core to add "missing" eval rules to TCA
> (I only need some possitive votes for that patch ;-) )

Go, on, brave ones ;-) I will review the patch.

> Also the validation rules themselves have to be in sync (is
> alphanumerical really [a-zA-Z0-9]* ?? What about diacriticals?)

There are different points of view about the meaning of "alphanumeric". 
IMO it is ok to allow only "word characters" and "numbers". The problem 
with the rule [a-zA-Z0-9] is IMO that it neglect other charsets than 
ASCII. What about Chinese symbols?

Lot of work ahead ...

ATM I work on a better solution to filter out XSS (TextValidator).

Regards
Jochen

-- 
Every nit picked is a bug fixed



More information about the TYPO3-project-typo3v4mvc mailing list