Problem/Motivation

webform.element.color.js calls jQuery UI's $.fn.uniqueId() to assign an id to the generated color-output input. uniqueId() is a jQuery UI method, not part of jQuery core. Drupal 11 ships jQuery 4, which drops the old jQuery UI method shims, so on any page that renders a webform color element the script throws uniqueId is not a function and the color output field is never enhanced.

The call is still present in 6.2.x and 6.3.x. #3512816: jQuery.isFunction is removed in jQuery 4.0+ fixed $.isFunction in another file but didn't touch this one.

Steps to reproduce

On a Drupal 11 site, add a color element to a webform and view the form. The console shows the TypeError and the color output field doesn't render.

Proposed resolution

Replace the single uniqueId() call with a module-local incrementing counter to generate the id. Patch attached.

Comments

dylan donkersgoed created an issue. See original summary.

liam morland’s picture

Status: Needs review » Needs work
Issue tags: +Needs merge request

Thanks for the patch. Please create a merge request.

liam morland’s picture

Issue summary: View changes