Problem/Motivation
When setting a time step for a date field in a webform, this one won't submit unless the time interval is met and since the user can input the time manually, it doesn't really matter if we use the Jquery time picker that will display a dropbox with 15 minute interval time.
There is no error being shown, just a reload of the page without any information, I couldn't find anything in the logs too.
Steps to reproduce
- Create a webform
- Add a Date/time field
- In time settings, pick a time element and set the time interval of your like
- Go to the webform view
- Change the time to anyone out of the interval that you set. (e.g. if you set an interval of 30, set any time that's not :00 or :30)
- Submit the form
Proposed resolution
Round the time to the expected interval every time the user inputs a time out of it.
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Error-msg.png | 55.7 KB | kasliwal_harshit |
| #2 | 3371639-2.patch | 589 bytes | jrockowitz |
| #2 | webform.webform.issue_3371639.yml | 4.85 KB | jrockowitz |
Issue fork webform-3371639
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 #2
jrockowitz commentedThe attached webform replicates the issue and attached patch fixes the issue.
I would like to determine what is setting the
$element['time']['#error_no_message']Comment #3
jrockowitz commentedThe
$element['time']['#error_no_message'] = TRUE;is coming from Drupal core via the DateTime element@see https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
#2839076: Datetime error message can be unclear depending on the time of day
#2827034: DateList and date range inline form errors are repeated
I do not seeing any proposed solution.
Comment #4
kasliwal_harshit commentedHI @jrockowitz , i followed the steps mentioned in the issue and tried to replicate the issue using the webform yml mentioned in (#2) however when i tried to submit the from with date which is out of the interval i can see the error msg regarding the rounding off date field. Adding the screenshot for the same .
Can you please mention if there is a special edge case or am I missing something to reproduce this issue ?
I am working with webform 6.2.x-dev and D9.5.8 for the same.
Comment #5
jrockowitz commentedYou probably need to have the clientside_validation.module enabled with the inline_form_error.module.
Comment #7
jrockowitz commentedThe MR includes a full work-around. If all the tests pass, this can be merged.
Comment #8
jrockowitz commented