Feature #45409

Support validation of abstract nested properties

Added by Aske Ertmann over 2 years ago. Updated about 2 years ago.

Status:New Start date:2013-02-12
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:Validation
Target version:-
PHP Version: Complexity:medium
Has patch:No

Description

Currently the validation of properties in action controllers does not take the property mapping configuration into account causing missing validation of nested abstract properties.

If you have an entity which has a collection of or is an abstract entity, it is possible to use the property mapping configuration to set which kind of abstract entity you'd want to convert/typehint to. But that is not respected in the validator resolver meaning that the validator resolver only returns a conjunction validator for the properties in the abstract entity and not the typehintet one.

There are two reasons for implementing this, which are 1) the missing validation leads to exceptions when the nested properties are persisted in the entity manager, 2) the validation is missing in the form.

Example:
Account (Security) has a party property which is of type \TYPO3\Party\Domain\Model\AbstractParty.

Then we have a \TYPO3\Party\Domain\Model\Person which extends the AbstractParty which has some more properties than the abstract party does. In the property mapping configuration I get configure it to use Person instead of a AbstractParty, but the validation resolves with AbstractParty meaning that the extra properties and their validation doesn't get taken into account.

Solution:
I think the solution should be to tie the property mapping configuration to the validator resolver so when it's actually resolving validators for a property of an action controller it can check if any special converters where used to change the type of the property.

History

#1 Updated by Aske Ertmann over 2 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow

#2 Updated by Aske Ertmann over 2 years ago

  • Category set to Validation
  • Target version set to 2.1
  • Has patch set to No
  • Complexity set to medium

#3 Updated by Robert Lemke about 2 years ago

  • Target version deleted (2.1)

Also available in: Atom PDF