Problem/Motivation

Drupal Core 9.3.10 has updated jquery ui. See https://www.drupal.org/project/drupal/releases/9.3.10

Especially

Previously, jQuery UI was an emeritus (unsupported) project. However, it recently began receiving support again. Therefore, Drupal core has replaced its fork of jQuery UI with jQuery UI itself, to make it easier to keep it up to date. Additionally, core's jQuery UI package dependencies have been updated to jQuery UI 1.13.1. The unminified source code is kept in core to allow easy audit during future library updates.

And I start to see errors this.element.form is not a function whe trying to instantiate selectmenu().

This error comes from the duplicated form-reset-mixin-min.js file, which have been updated with Drupal Core 9.3.10

Proposed resolution

Not really sure, but I get the new form-reset-mixin-min.js from Core and replace it in this module, and all is working again.

Remaining tasks

Find the "right" fix. Does this module makes sens if Drupal Core embed again jquery UI ?

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

flocondetoile created an issue. See original summary.

flocondetoile’s picture

Issue summary: View changes
flocondetoile’s picture

StatusFileSize
new2.21 KB

This patch replace the file with the new version (jQuery UI Form Reset Mixin 1.13.1).

joncjordan’s picture

Also seeing this error:

Uncaught TypeError: a.ui.escapeSelector is not a function
at t...mousedown (selectmenu-min.js?v=1.12.1:4:5602)

It occurs when you click on the selectmenu element.

Similar to the previously-stated issue, this is fixed by updating to jQuery UI Selectmenu 1.13.1. Is there any plan to release an updated version of this module (and other Jquery ui modules) with v1.13.1 of jQuery UI?

mulambo’s picture

Status: Active » Needs review
StatusFileSize
new20.88 KB

I've updated patch with selectmenu 1.13.1 (not just form mixin).

a.ui.escapeSelector has been removed from jQuery in version 3.0 and jQuery UI1.13.1 is using $.escapeSelector (see Dropped $.ui.escapeSelector).

There is jQuery UI polyfill patch to use $.escapeSelector with jQuery 1.8.0 - 2.2.4, but since Drupal 9 is using jQuery 3.0+, I've ommited it from patch.

EDIT: I've updated core requirements for module, to match core 9.3.10+, since we don't have jQuery UI 1.13 in lower versions. Patch can be extracted from merge request (https://git.drupalcode.org/project/jquery_ui_selectmenu/-/merge_requests...)

radelson’s picture

Status: Needs review » Reviewed & tested by the community

This is working for us and this patch makes sense. I'm marking it as RTBC.

We had both errors following the Drupal core 9.3.10 update.

- Uncaught TypeError: a.ui.escapeSelector is not a function
at t...mousedown
- this.element.form is not a function

These changes fix them both and don't seem to impact the functionalities.

kevin.dutra’s picture

Assigned: Unassigned » kevin.dutra
Status: Reviewed & tested by the community » Needs work

Things are getting a little dicier with both a patch file and a merge request, especially because they're not in sync. Anywho, moving this back to needs work for a couple of things:

  1. As @Mulambo mentioned in #5, we have to bump up the core version requirement due to incompatibilities. This is reflected in the merge request, but not in the patch file.
  2. The library version info needs to be updated to reflect the updated files. That version info is used as a cache buster to ensure that browsers don't use the cached (old) version of the JS files. Neither the patch file nor the merge request include this.
kevin.dutra’s picture

Status: Needs work » Needs review
StatusFileSize
new21.84 KB
new10.44 KB

Here is an updated patch. (Note: At the moment, this patch file is now further along in development than the merge request.)

kevin.dutra’s picture

Assigned: kevin.dutra » Unassigned
flocondetoile’s picture

issue not anymore relevant for 2.x version