Skip to content

Commit

Permalink
merged branch TonyMalz/VALIDATORT_TYPEGUESS_FIX (PR #4251)
Browse files Browse the repository at this point in the history
Commits
-------

f883953 TypeGuess fixed for Date/Time constraints
41bed29 [Form] fixed invalid 'type' option in ValidatorTypeGuesser for Date/TimeFields

Discussion
----------

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

Automatic field type guessing breaks, if you use any of the Date/Time
constraints (i.e. Symfony\Component\Validator\Constraints\DateTime), since these field types have no 'type' option defined.
(See getDefaultOptions() in DateTimeType.php)

---------------------------------------------------------------------------

by travisbot at 2012-05-10T15:25:16Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1296309) (merged 005bdbb0 into 68eca0f9).

---------------------------------------------------------------------------

by travisbot at 2012-05-18T15:50:39Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1367774) (merged f8839532 into a04acc89).

---------------------------------------------------------------------------

by TonyMalz at 2012-05-18T15:58:57Z

@bschussek Ok, changed it to 'input'

---------------------------------------------------------------------------

by bschussek at 2012-05-22T08:18:27Z

:+1:
  • Loading branch information
fabpot committed May 22, 2012
2 parents 103190e + bb288dd commit a46d1ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Extension/Validator/ValidatorTypeGuesser.php
Expand Up @@ -134,13 +134,13 @@ public function guessTypeForConstraint(Constraint $constraint)
case 'Symfony\Component\Validator\Constraints\Date':
return new TypeGuess(
'date',
array('type' => 'string'),
array('input'=>'string'),
Guess::HIGH_CONFIDENCE
);
case 'Symfony\Component\Validator\Constraints\DateTime':
return new TypeGuess(
'datetime',
array('type' => 'string'),
array('input'=>'string'),
Guess::HIGH_CONFIDENCE
);
case 'Symfony\Component\Validator\Constraints\Email':
Expand Down Expand Up @@ -212,7 +212,7 @@ public function guessTypeForConstraint(Constraint $constraint)
case 'Symfony\Component\Validator\Constraints\Time':
return new TypeGuess(
'time',
array('type' => 'string'),
array('input'=>'string'),
Guess::HIGH_CONFIDENCE
);
case 'Symfony\Component\Validator\Constraints\Url':
Expand Down

0 comments on commit a46d1ac

Please sign in to comment.