Date constraint throws an ErrorException #2609

Closed
ondrowan opened this Issue Nov 11, 2011 · 0 comments

Comments

Projects
None yet
2 participants
@ondrowan
Contributor

ondrowan commented Nov 11, 2011

Date / Birthday constraint works properly only if I write incorrect number to any of the fields. When I edit some of the values to string I keep getting error 500 (ErrorException) because checkdate expects parameters to be integers. Although this happens only if someone manually overrides values in select, I still think it should be consistent with other validators and simply return error message saying the format is wrong.

fabpot added a commit that referenced this issue Nov 11, 2011

merged branch ondrowan/2.0 (PR #2614)
Commits
-------

2582fcb Added tests for string fix in DateTimeToArrayTransformer (8351a11).
8351a11 Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609

Discussion
----------

Fix for #2609

Second take for fix for #2609, hope it's ok now. Tests are failing without my fix and passing with it.

@fabpot fabpot closed this Nov 11, 2011

fabpot added a commit that referenced this issue Nov 11, 2011

Merge branch '2.0'
* 2.0:
  [Form] fixed previous merge
  [Form] simplified previous merge
  Also identify FirePHP by the X-FirePHP-Version header
  [TwigBundle] Extract output buffer cleaning to method
  [TwigBundle] Do not clean output buffering below initial level
  Fixed rendering of FileType (value is not a valid attribute for input[type=file])
  Added tests for string fix in DateTimeToArrayTransformer (8351a11).
  Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609
  [Translation] removed unneeded methods
  [Translation] added detection for circular references when adding a fallback catalogue
  [DomCrawler] trim URI in getURI
  [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment