Core javascipt files do not compayible with jQuery 3.1

Core depending on andSelf method from Jquery. This method has been deprecated in Jquery 1.8 and finally removed in 3.0.0

Simple solution just add check in in misc/form.js

+    if (typeof $.fn.andSelf != 'undefined' && $.isFunction($.fn.andSelf)) {
-    $(context)
+      $(context)
       // Since context could be an input element itself, it's added back to
       // the jQuery object and filtered again.
      .find(':input').andSelf().filter(':input')
       // To prevent duplicate events, the handlers are first removed and then
       // (re-)added.
-      .unbind(events).bind(events, function () {
+        .unbind(events).bind(events, function () {
         $(this).trigger('formUpdated');
       });
+    }else {
+      $(context)
+        .find(':input').addBack().filter(':input')
+        .unbind(events).bind(events, function () {
+        $(this).trigger('formUpdated');
+      });
+    }

Comments

amme created an issue. See original summary.

amme’s picture

cilefen’s picture

Status: Active » Needs review

Status: Needs review » Needs work
mustanggb’s picture

Isn't this what jQuery Update is for?

amme’s picture

it seems it work for jquery_migrate plugin

amme’s picture

Status: Needs work » Closed (works as designed)
karamveersingh’s picture

@amme I've been using the same library 3.1 and it is conflicting with 1.8 core library. Before using your patch please confirm Is that patch come in the next updates as part of Core-Drupal 7 ?