do not validate empty values
This commit is contained in:
parent
7acc34537b
commit
fd7ad234bc
@ -62,6 +62,10 @@ class UniqueEntityValidator extends ConstraintValidator
|
||||
throw new ConstraintDefinitionException('At least one field has to be specified.');
|
||||
}
|
||||
|
||||
if (null === $entity) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($constraint->em) {
|
||||
$em = $this->registry->getManager($constraint->em);
|
||||
|
||||
|
@ -39,6 +39,10 @@ class UserPasswordValidator extends ConstraintValidator
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UserPassword');
|
||||
}
|
||||
|
||||
if (null === $password || '' === $password) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user = $this->tokenStorage->getToken()->getUser();
|
||||
|
||||
if (!$user instanceof UserInterface) {
|
||||
|
@ -48,7 +48,7 @@ class UrlValidator extends ConstraintValidator
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url');
|
||||
}
|
||||
|
||||
if (null === $value) {
|
||||
if (null === $value || '' === $value) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user