Opened 7 years ago

Closed 7 years ago

#8521 closed bug (notabug)

Error in sortable (match is not a function)

Reported by: gtraxx Owned by: gtraxx
Priority: minor Milestone: 1.9.0
Component: ui.sortable Version: 1.8.23
Keywords: Cc:
Blocked by: Blocking:

Description

Hello, I detect a bug with jquery sortable using jquery 1.7.2 and the update parameter

Example :

   $("ul#sortproduct").sortable({
	placeholder: 'ui-state-highlight',
        dropOnEmpty: false,
	axis: "y",
	cursor: "move",
	update : function (event, ui) {
	    var serial = $(this).sortable("serialize");
            //Ajax request ....
        }
   });

In Firebug :

TypeError: ($(o.item || this).attr(o.attribute || "id") || "").match is not a function

Probleme line 3698:

$(items).each(function() {
  var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
  if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
});

Test Solution :

$(items).each(function() {
 var res = ($(o.item || this).prop(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
 if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
});

Change History (3)

comment:1 Changed 7 years ago by Scott González

Owner: set to gtraxx
Status: newpending

Please provide a reduced test case using jsFiddle or jsbin that reproduces the problem.

comment:2 Changed 7 years ago by gtraxx

Status: pendingnew

Thank you, after analysis and verification, the bug is visible only if jQuery tinymce 3.4.8 is loaded I test with jQuery tinymce 3.5.6 and everything works fine. Collisation with the tinyMCE jQuery 3.4.x is responsible for this error.

Best regards

Gerits Aurelien

comment:3 Changed 7 years ago by Scott González

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.