sonata-project/SonataUserBundle — Issue #40: Profile validation_groups concern
Author: goyote
Created: 2012-01-24 03:21:51+00:00
State: open

Recently, someone implemented this:

protected $formOptions = array(
'validation_groups' => 'Profile'
);

That's perfect for editing a user, because the plainpassword field will not be required in order to update the existing user. However, when creating a new user, it is possible to submit the form without a password which would cause a fatal error.

How can I use the "Profile" validation group for editing a user, and the "Registration" group when creating a new user?