Grails
  1. Grails
  2. GRAILS-9165

Cannot bind Date to subclass domain posting from enctype=multipart/form-date

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.0.3, 2.0.4
    • Fix Version/s: 2.0.5, 2.1-RC3
    • Component/s: Data binding
    • Labels:
    • Environment:
      Windows 7 64-bit

      Description

      Posting from g:uploadForm (enctype="multipart/form-data" makes the difference) a Date value binding to a domain subclass reports:

      Field error in object 'dtest.BigEvent' on field 'startDate': rejected value [null]; codes [typeMismatch.dtest.BigEvent.startDate,typeMismatch.startDate,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [dtest.BigEvent.startDate,startDate]; arguments []; default message [startDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'startDate'; nested exception is java.lang.IllegalArgumentException: Could not parse date: Unparseable date: "date.struct"]

      1. BigEvent extends Event
      2. g:uploadForm must be used instead of g:form

      I am uploading simple app that will show the error.

        Issue Links

          Activity

          Hide
          Oleg Timofeyev added a comment -

          Is there more information I can provide to get anyone to look into this issue?

          Show
          Oleg Timofeyev added a comment - Is there more information I can provide to get anyone to look into this issue?
          Hide
          Jeff Scott Brown added a comment -

          This isn't really the same problem as GRAILS-8998 but the 2 were fixed at the same time. When testing the fix for GRAILS-8998 I realized the inheritance problem as it relates to structured editors and fixed it. That fix covers the issue described here as well.

          Sorry for the trouble.

          Show
          Jeff Scott Brown added a comment - This isn't really the same problem as GRAILS-8998 but the 2 were fixed at the same time. When testing the fix for GRAILS-8998 I realized the inheritance problem as it relates to structured editors and fixed it. That fix covers the issue described here as well. Sorry for the trouble.
          Hide
          Oleg Timofeyev added a comment -

          Excellent! Thanks, Jeff.

          Show
          Oleg Timofeyev added a comment - Excellent! Thanks, Jeff.
          Hide
          Jeff Scott Brown added a comment -

          Oleg,

          No problem. If you care to help verify the change you can grab the latest 2.0.5 snapshot at http://hudson.grails.org/view/Grails%202.0.x/job/grails_core_2.0.x/lastSuccessfulBuild/artifact/build/distributions/. If you do, please report back here.

          Thanks for reporting the issue.

          Show
          Jeff Scott Brown added a comment - Oleg, No problem. If you care to help verify the change you can grab the latest 2.0.5 snapshot at http://hudson.grails.org/view/Grails%202.0.x/job/grails_core_2.0.x/lastSuccessfulBuild/artifact/build/distributions/ . If you do, please report back here. Thanks for reporting the issue.
          Hide
          Oleg Timofeyev added a comment -

          Tested with the latest 2.0.5 snapshot and this issue is fixed. Thank you.

          Show
          Oleg Timofeyev added a comment - Tested with the latest 2.0.5 snapshot and this issue is fixed. Thank you.
          Hide
          Jeff Scott Brown added a comment -

          Thanks for the feedback Oleg.

          Show
          Jeff Scott Brown added a comment - Thanks for the feedback Oleg.

            People

            • Assignee:
              Jeff Scott Brown
              Reporter:
              Oleg Timofeyev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development