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

Issue fork webform-3371639

Command icon 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

alexortega_98 created an issue. See original summary.

jrockowitz’s picture

Version: 6.0.x-dev » 6.2.x-dev
Status: Active » Needs review
StatusFileSize
new4.85 KB
new589 bytes

The 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']

jrockowitz’s picture

The $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.

kasliwal_harshit’s picture

StatusFileSize
new55.7 KB

HI @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.

jrockowitz’s picture

You probably need to have the clientside_validation.module enabled with the inline_form_error.module.

jrockowitz’s picture

The MR includes a full work-around. If all the tests pass, this can be merged.

jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed 5cac2b45 on 6.2.x
    Issue #3371639 by jrockowitz: The form won't submit if the user enters a...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.