Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
|
|||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
|
||||
/**
|
||||
|
@ -30,7 +31,17 @@ class NotNullValidator extends ConstraintValidator
|
|||
}
|
||||
|
||||
if (null === $value) {
|
||||
$this->context->addViolation($constraint->message);
|
||||
if ($this->context instanceof ExecutionContextInterface) {
|
||||
$this->context->buildViolation($constraint->message)
|
||||
->setParameter('{{ value }}', $this->formatValue($value))
|
||||
->setCode(NotNull::IS_NULL_ERROR)
|
||||
->addViolation();
|
||||
} else {
|
||||
$this->buildViolation($constraint->message)
|
||||
->setParameter('{{ value }}', $this->formatValue($value))
|
||||
->setCode(NotNull::IS_NULL_ERROR)
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue