Bug #4857

ValidatorResolver tries to use data type as validator type

Added by Karsten Dambekalns almost 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-10-02
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Validation
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 6
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

When buildMethodArgumentsValidatorConjunctions() iterates over method arguments, it tries to get a validator for each type. This works for simple types, but for objects the class name is used as validator directly. This is a) nonsense and b) causes circular dependency problems to begin with.

The problem is caused $typeValidator = $this->createValidator($methodParameter['type']);, since createValidator() expects to get either one of the internal validator shorthands or the fully qualified name of a validator - but not a data type!

Associated revisions

Revision b684099d
Added by Karsten Dambekalns almost 6 years ago

[+BUGFIX] FLOW3 (Validation): ValidatorResolver no longer tries to use action method argument data type as validator type, fixes #4857. Optimized a little.

History

#1 Updated by Bastian Waidelich almost 6 years ago

Additional note: IIRC resolveValidatorObjectName() calls isObjectRegistered() on the object manager (and fires the FLOW3 autoloader) for simple types too. As arguments are mostly non-objects, this could be a performance issue..

#2 Updated by Karsten Dambekalns almost 6 years ago

Bastian Waidelich wrote:

Additional note: IIRC resolveValidatorObjectName() calls isObjectRegistered() on the object manager (and fires the FLOW3 autoloader) for simple types too.

isObjectRegistered() is more or less a simple isset() - no autoloader involved.

#3 Updated by Karsten Dambekalns almost 6 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3288.

Also available in: Atom PDF