Problem/Motivation

With the new jquery 3 added in Drupal 8.4 I got the following error when I use checkboxradio or selectmenu as they depend on form-reset-mixin:
Uncaught TypeError: this._bindFormResetHandler is not a function

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

edurenye created an issue. See original summary.

edurenye’s picture

Status: Active » Needs review
FileSize
743 bytes

Done.

edurenye’s picture

scape-selector is also missing and throws error.

droplet’s picture

Can anyone write a simple script to grab the dependency from AMD? (Either NODEJS / PHP)

https://github.com/jquery/download.jqueryui.com/blob/master/lib/jquery-u...

edurenye’s picture

Assigned: edurenye » Unassigned
flocondetoile’s picture

Same issue after an upgrade to 8.4, using jquery ui selectmenu. Patch #3 fix the issue.

asherry’s picture

patch #3 didn't apply for me, and didn't work without the form-reset-mixin-min file which must have been taken out.

assets/vendor/jquery.ui/ui/form-reset-mixin-min.js

I re-patched but my guess is that was taken out for a reason.

Status: Needs review » Needs work

The last submitted patch, 7: 2906737.patch, failed testing. View results

asherry’s picture

sorry, for some reason my repo has the git directory in /core.

asherry’s picture

Status: Needs work » Needs review
paulmckibben’s picture

Status: Needs review » Reviewed & tested by the community

This fixes the issue for me. I strongly urge this patch be committed and included in the next 8.4.x core release. Without this patch, functionality is broken in one of my clients' sites. Thanks!

GrandmaGlassesRopeMan’s picture

Issue tags: +JavaScript
xjm’s picture

Title: With the new jquery 3 checkboxradio and selectmenu error » jQuery UI checkboxradio and selectmenu errors following 8.4 update to jQuery 1.12
Issue tags: +Needs issue summary update

I talked about this with @drpal a bit. A few things that came up:

  1. @drpal pointed out to me that these are in jQuery UI, not jQuery.
    https://jqueryui.com/checkboxradio/
    https://jqueryui.com/selectmenu/
  2. We had a change record for the jQuery 3 update in https://www.drupal.org/node/2898818 which linked https://jquery.com/upgrade-guide/3.0/, but we did not have an equivalent change record for #2809427: Update jQuery UI to 1.12.
  3. There's a way in which this is a BC break, because apparently jQuery UI previously bundled these things and has now split these out.
  4. On the other hand, these two jQuery UI plugins are not used in core, and we don't necessarily want to include lots of plugins in core that most sites won't need. An individual contrib or cutom module or theme could possibly include them instead.
  5. It would be good to have a policy around what core bundles and what it doesn't. I see that there's #2926155: Follow-up to #2809427: update from jQuery UI 1.11.4 to 1.12.1 forgot to list some new JS files in *.libraries.yml related to that.
  6. These particular two are only 1k each, so it's not too much additional JS.

So I'm leaning toward maybe committing this since there was a BC break for vendor code and the consequences of adding them back might not be too serious, but OTOH it might be worth discussing whether these don't actually belong in core and there's instead a better workaround for this to provide them for custom code.

Leaving at RTBC for now. Thanks!

droplet’s picture

We can make a quick decision on #2926155 instead and update them all once. We don't need any frontend review one-by-one since it's AMD module

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Is the original issue caused by checkboxradio not being usable without escape-selector? Or is this issue about solving the BC break and adding these dependencies because someones specific usage of checkboxradio might require escape-selector? I tried to check the jQuery UI docs and I couldn’t find anything about explicit dependency between these two (http://api.jqueryui.com/checkboxradio/)?

Marking this as NW since it would be great to get an issue summary update on this.

droplet’s picture

I tried to check the jQuery UI docs and I couldn’t find anything about explicit dependency

Read the source file. It's AMD. For example:
https://github.com/jquery/jquery-ui/blob/master/ui/widgets/selectmenu.js...

That's why I said in #14 to patch them all at once it more efficient.
(we don't know how many widgets still missing dependency but haven't reported in d.org yet)

droplet’s picture

lauriii’s picture

Status: Needs work » Closed (duplicate)

@droplet thanks for pointing that out. I agree that we should fix all of these at once to be effective. Closing this issue as a duplicate to #2926155: Follow-up to #2809427: update from jQuery UI 1.11.4 to 1.12.1 forgot to list some new JS files in *.libraries.yml.