Steps to reproduce

Turn off "use timepicker", try to submit time in HH:ii:ss format

Proposed resolution

timepicker should only attach to an element when setting is enabled.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork webform-3524216

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

cp_dev created an issue. See original summary.

anpri31’s picture

I'm also experiencing this issue after upgrading. Even when "Use timepicker" is disabled in the Webform time element, the jquery-timepicker still attaches to the input, which breaks native type="time" behavior and causes validation errors (e.g., "The specified value '12:03 AM' does not conform to the required format").

Is there any update or workaround available for this? We’d prefer not to switch the field type or rewrite the form structure.

cilefen’s picture

You experienced this after upgrading specifically which versions of which software?

anpri31’s picture

facing this issue after upgrading to Drupal 11 & my webform version is 6.3.0-beta2

cilefen’s picture

What were the initial versions?

anpri31’s picture

earlier version was 6.2.7 which was working fine

cilefen’s picture

git log -S timepicker 6.2.7..6.3.0-beta2 shows that #3495674: Fix broken tests and #3461552: Require minimum of Drupal 10.2 and remove compatibility shims are the changes affecting "timepicker" directly that are only in 6.3.

liam morland’s picture

Version: 6.3.0-beta1 » 6.3.x-dev
pepeprawn’s picture

My solution:
This patch makes two targeted changes:

Updates the JavaScript selector to only attach to input[type="text"] elements, preventing interference with native HTML5 time inputs
Only adds the data-webform-time-format attribute when #timepicker is explicitly TRUE

Testing:

Tested on Drupal 11.0.5 with Webform 6.3.x
Confirmed that with "Use timepicker" disabled, native HTML5 time inputs work correctly
Confirmed that with "Use timepicker" enabled, jQuery timepicker functions as expected
Form submissions work properly in both modes

This is a minimal change that maintains backward compatibility while fixing the reported issue.

dmitrii puiandaikin’s picture

Issue summary: View changes

Got the issue after upgrading to Drupal 11, the patch has fixed the issue

abramm’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

Faced the same issue, the patch from #9 worked well.
Moving to RTBC.

daletrexel’s picture

Just chiming in to say that we're running patch from #9 in production and it seems to be working fine for us.

liam morland’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the patch. Please put the patch into an issue fork and merge request.

robijntje94 made their first commit to this issue’s fork.

robijntje94 changed the visibility of the branch 3524216-jquery-timepicker-setting to hidden.

robijntje94 changed the visibility of the branch 3524216-jquery-timepicker-setting to active.

robijntje94 changed the visibility of the branch 3524216-jquery-timepicker-setting to active.

robijntje94’s picture

Sorry for the inconvenience. Everything wasn't working properly. I have no credits on this one.

liam morland’s picture

Does the patch not apply? I do not seen any commits on the merge request branch, 3524216-jquery-timepicker-setting.

jrockowitz made their first commit to this issue’s fork.

jrockowitz’s picture

Status: Needs work » Needs review

jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

This feels very safe moving to RTBC if tests pass

  • jrockowitz committed 863b5a61 on 6.3.x
    Issue #3524216 by jrockowitz, robijntje94, liam morland, pepeprawn,...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

  • jrockowitz committed 863b5a61 on 6.x
    Issue #3524216 by jrockowitz, robijntje94, liam morland, pepeprawn,...

Status: Fixed » Closed (fixed)

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