Allow disabling validation for action arguments
|Priority:||Must have||Due date:|
|Assignee:||Robert Lemke||% Done:||
|Target version:||TYPO3 Flow Base Distribution - 1.0 alpha 3|
In situations where a knowingly incomplete / invalid argument needs to be passed to an action, for example an edit action, it is necessary to disable validation for a single or multiple arguments. This should be possible by calling a disableValidation() method on the argument object or by adding a @dontvalidate $argumentName annotation to an action method.
|related to Extbase MVC Framework - Bug #4178: Update Extbase persistence and validation||Resolved||2009-08-06|
[+FEATURE] FLOW3 (MVC): It is now possible to disable validation temporarily for single controller arguments. This is necessary in situations where a knowingly incomplete / invalid argument needs to be passed to an action, for example an edit action. Validation can be disabled either by calling the disableValidation() method on the argument object or by adding a @dontvalidate $argumentName annotation to an action method. Resolves #4166
[+TASK] FLOW3 (Documentation): Documented the new @dontvalidate annotation.
[+FEATURE] FLOW3 (Package): The package manager's command line controller now returns a friendly error message on trying to activate or deactivate an already active or inactive package. Earlier it just threw an unpolished exception.
[+FEATURE] FLOW3 (Persistence): Implemented an update() method for the base repository which allows for conveniently updating existing objects. update() only expects one argument which must be a clone of the object to replace, already containing the modifications. The object passed to update() must internally contain the same uuid like the object to be updated (ie. replaced). In fact this new update() method is basically a more convenient way to call replace(). Resolves #4167
[+BUGFIX] FLOW3 (MVC): A @validate annotation placed in an action method's comment replaced existing rules instead of adding them to a common conjunction validator. By this it was possible to override any validation rule with a simple @validate $foo Raw annotation. Fixes #4168
Updated by Robert Lemke almost 4 years ago
Technical background: the flag "validationDisabled" is recognized by the ArgumentsValidator: if it is set, the given argument is not included in the property validation and thus ignored.