소스 검색

Merge pull request #699 from pulse00/master

[2.1 BC fix] Upgraded to latest changes in ConstraintValidatorInterface
Thomas 13 년 전
부모
커밋
6b469ad375
1개의 변경된 파일2개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 6
      Validator/ErrorElement.php

+ 2 - 6
Validator/ErrorElement.php

@@ -115,14 +115,10 @@ class ErrorElement
         $validator  = $this->constraintValidatorFactory->getInstance($constraint);
         $value      = $this->getValue();
 
-        $validator->isValid($value, $constraint);
-
-        $this->context->setPropertyPath($this->getFullPropertyPath());
-        $this->context->setGroup($this->group);
-
         $validator->initialize($this->context);
+        $validator->validate($value, $constraint);
 
-        if (!$validator->isValid($value, $constraint)) {
+        if (count($this->context->getViolations())) {
             $this->context->addViolation(
                 $messageTemplate ?: $validator->getMessageTemplate(),
                 array_merge($validator->getMessageParameters(), $messageParameters),