Problem/Motivation
Part 7 of splitting #3595219: 3.0 Exploration, and the follow-up to #3598994: Date/time field exposure (date/time field exposure). This issue handles submitting and validating date/time values, which is substantial enough to warrant its own change.
Problems in 3.x:
- Submission input for
datelistanddateelements is not parsed/processed into the format Webform expects, so valid date submissions are rejected or stored incorrectly. - Multiple-value date elements (a
#multipledate/datetime) cannot be submitted or validated correctly.
Proposed resolution
- Parse and process datelist/date submission input in
src/Plugin/GraphQL/DataProducer/WebformSubmit.php, converting the incoming values into what Webform's validation and storage expect. - Handle multiple date/datetime values, including validation of each value.
This depends on #3598994: Date/time field exposure because the test fixtures and exposed shape of the date elements are introduced there; keeping submission separate keeps both diffs reviewable.
Remaining tasks
- Implement datelist/date input parsing in
WebformSubmit.php. - Handle and validate multiple date/datetime values.
- Tests:
DatetimeExtrasTest, and mutation testsFormSubmissionDatelistTest,FormSubmissionMultiDatetimeTest,FormSubmissionDateFamilyValidationTest, plus shared test-form additions.
API changes
Additive/correctness: date, datelist and datetime submissions (single and multiple value) are now accepted and validated. No fields removed.
Release notes snippet
Date, datelist and datetime elements can now be submitted and validated through GraphQL, including multiple-value date fields.
Issue fork graphql_webform-3599000
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
pfrenssen