[Flow] Problem with duplicate validation

Helmut Hummel helmut.hummel at typo3.org
Tue Oct 8 13:19:47 CEST 2013


Hi!

On 27.09.13 15:34, Sil via wrote:

> I implemented a Validator for a model class (Country), I stored it in Validator directory and it is called automatically. The problem is that it is called twice, I followed the instructions contained in Definitive Guide "Avoid Duplicate Validation" and I declared my Validator like below:
>
> class CountryValidator extends \TYPO3\Flow\Validation\Validator\GenericObjectValidator {
> }
>
> overriding only the isValid() method.

Just extending from AbstractValidator and implementing the isValid() 
method would be enough.

> But still the validation is called twice. It seems that the InstanceContainier is always NULL and every time re-created.

Assuming your validator is in the namespace Domain\Validator then this 
is a bug:

http://forge.typo3.org/issues/49624

You can test the pending patch on Gerrit:

https://review.typo3.org/24174

Kind regards,
Helmut

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 Core Developer, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the Flow mailing list