Feature #4166

Allow disabling validation for action arguments

Added by Robert Lemke about 10 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
MVC
Start date:
2009-08-06
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

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.

Associated revisions

Revision 10ec9ad8 (diff)
Added by Robert Lemke about 10 years ago

[+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

History

#1 Updated by Robert Lemke about 10 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.

#2 Updated by Robert Lemke about 10 years ago

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

Applied in changeset r2989.

Also available in: Atom PDF