소스 검색

[Form] fixed invalid 'type' option in ValidatorTypeGuesser for Date/TimeFields

Field type guessing breaks, if you use any of the Date/Time
constraints, since these field types have no 'type' default option
defined.
Tony Malzhacker 13 년 전
부모
커밋
41bed29c80
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php

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

@@ -134,13 +134,13 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
             case 'Symfony\Component\Validator\Constraints\Date':
                 return new TypeGuess(
                     'date',
-                    array('type' => 'string'),
+                    array(),
                     Guess::HIGH_CONFIDENCE
                 );
             case 'Symfony\Component\Validator\Constraints\DateTime':
                 return new TypeGuess(
                     'datetime',
-                    array('type' => 'string'),
+                    array(),
                     Guess::HIGH_CONFIDENCE
                 );
             case 'Symfony\Component\Validator\Constraints\Email':
@@ -212,7 +212,7 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
             case 'Symfony\Component\Validator\Constraints\Time':
                 return new TypeGuess(
                     'time',
-                    array('type' => 'string'),
+                    array(),
                     Guess::HIGH_CONFIDENCE
                 );
             case 'Symfony\Component\Validator\Constraints\Url':