Browse Source

[2.1 BC fix] Upgraded to latest changes in ConstraintValidatorInterface
;

Robert Gruendler 13 years ago
parent
commit
61253cdf77
1 changed files with 2 additions and 6 deletions
  1. 2 6
      Validator/ErrorElement.php

+ 2 - 6
Validator/ErrorElement.php

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