Skip to content

Loading…

Date constraint throws an ErrorException #2609

Closed
ondrowan opened this Issue · 0 comments

2 participants

@ondrowan

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.

@ondrowan ondrowan added a commit that referenced this issue
@ondrowan ondrowan Added check for array fields to be integers in reverseTransform metho…
…d. 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
92f9e75
@ondrowan ondrowan added a commit that referenced this issue
@ondrowan ondrowan Added check for array fields to be integers in reverseTransform metho…
…d. 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
8351a11
@ondrowan ondrowan referenced this issue
Merged

Fix for #2609 #2614

@fabpot fabpot added a commit that referenced this issue
@fabpot fabpot 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.
7475a39
@fabpot fabpot closed this
@fabpot fabpot added a commit that referenced this issue
@fabpot fabpot 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
21cec04
@dustinwhittle dustinwhittle referenced this issue
Commit has since been removed from the repository and is no longer available.
@realmfoo realmfoo added a commit that referenced this issue
@ondrowan ondrowan Added check for array fields to be integers in reverseTransform metho…
…d. 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
d0225b2
@mmucklo mmucklo pushed a commit that referenced this issue
@ondrowan ondrowan Added check for array fields to be integers in reverseTransform metho…
…d. 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
5eb496f
@mmucklo mmucklo pushed a commit that referenced this issue
@fabpot fabpot 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.
95e07d1
@mmucklo mmucklo pushed a commit that referenced this issue
@fabpot fabpot 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
f173ac5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.