Feature #32832

Implement context-specific validation through Validation Groups

Added by Sebastian Kurfuerst over 3 years ago. Updated over 3 years ago.

Status:Resolved Start date:2011-12-24
Priority:Should have Due date:
Assigned To:Sebastian Kurfuerst % Done:

100%

Category:Validation
Target version:TYPO3 Flow Base Distribution - 1.1
PHP Version: Complexity:
Has patch:No

Description

Sometimes, validation should only be executed on persist, sometimes on the controller invocation. Especially when building multi-step forms, one needs to be able to partially validate an object and store the invalid object in the database.

I'd suggest the concept of "Validation Groups" from Symfony: http://symfony.com/doc/current/book/validation.html#validation-groups

Each Validate annotation can get one or multiple validationGroups assigned; the "Default" validation group is used if none is specified.

When validating in the persistence layer, we use "Default" and "Persistence" as validation group; i.e. only validators which have either Default or Persistence assigned as validationGroup get executed.

When being inside a controller invocation, the used validation groups should be configurable; using "Default", "Controller" if none is specified.


Related issues

related to TYPO3.Flow - Feature #36695: Control Validation Groups and add Groups for Create and U... Resolved 2012-04-28

Associated revisions

Revision 7aebd16f
Added by Sebastian Kurfuerst over 3 years ago

[FEATURE] (Validation): Context-specific validation through Validation Groups

Sometimes, Validation should only be executed on Persist, or on the Controller
invocation. Especially when building multi-step forms, one needs to be able to
partially validate an object and store the invalid object in the database.

This change set implements "validation groups", i.e. each validator annotation
can have a "validation group" assigned, and when validation happens, the validators
get only executed if at least one validation group matches.

Furthermore, it adds a documentation skeleton for partial validation.

Resolves: #32832
Change-Id: I868310d3ff6352d1f9139a38d44296ec223553ee
Releases: 1.1

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7515

#2 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7515

#3 Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7515

#4 Updated by Gerrit Code Review over 3 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7515

#5 Updated by Gerrit Code Review over 3 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7515

#6 Updated by Sebastian Kurfuerst over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF