소스 검색

[Form] fixed guesser when a choice constraint is defined via a callback

Fabien Potencier 14 년 전
부모
커밋
a724774fc0
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php

+ 5 - 0
src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php

@@ -125,6 +125,11 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
                 }
                 break;
             case 'Symfony\Component\Validator\Constraints\Choice':
+                if (!$constraint->choices) {
+                    // choices probably defined as a callback
+                    break;
+                }
+
                 return new TypeGuess(
                     'choice',
                     array('choices' => $constraint->choices),