[FLOW3-general] Double Validation of Controller Arguments

Jeff Segars jsegars at alumni.rice.edu
Mon Nov 26 23:26:48 CET 2012


I'm running into a strange issue and was hoping for a little insight 
into whether I'm just missing something or it's actually a bug. The 
problem I'm seeing is occurring within a Neos plugin, but what I see so 
far looks to be Flow related rather than Neos.

I have a Person domain model in my package and a custom validator for 
that model. When I show validation errors on the editing form, any 
errors generated in my custom validator are appearing twice.

Here's what I'm seeing when digging into the code...

In 
\TYPO3\Flow\Mvc\Controller\ActionController->initializeActionMethodValidators(), 
the validatorResolver is used in two different places to come up with a 
list of validators.

In the first instance, buildMethodArgumentsValidatorConjunctions() finds 
my custom validator (see line 160 of 
\TYPO3\Flow\Validation\ValidatorResolver) and builds a 
ConjunctionValidator containing it (see line 160 of 
\TYPO3\Flow\Validation\ValidatorResolver).

A few lines later in ActionController, a call to 
getBaseValidatorConjunction() produces a similar ConjunctionValidator 
(see line 160 of \TYPO3\Flow\Validation\ValidatorResolver), which is 
added onto the ConjunctionValidator already in existence.

When the validation occurs, I get two error messages because the same 
validator is being added twice.

Is there something I'm missing on the config front that would avoid the 
validator being added twice or is it just a bug in need a fix?

Thanks!
Jeff


More information about the FLOW3-general mailing list