Bug Tracker

Opened 11 years ago

Closed 9 years ago

#3167 closed bug (fixed)

z.indexOf is not a function

Reported by: hkirsman Owned by: flesler
Priority: minor Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: select input Cc: hkirsman
Blocked by: Blocking:

Description

PROBLEM a specific jquery select and form with name=name gives "z.indexOf is not a function" error

CURRENT WORKAROUND - add form in front of the query

Attachments (2)

bug.html (512 bytes) - added by hkirsman 11 years ago.
bug with selection of 'input type=text name=name '
jqselecttest.html (564 bytes) - added by vlad 11 years ago.
Demo of selector failing on an unrelated to the selection elements

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by hkirsman

Attachment: bug.html added

bug with selection of 'input type=text name=name '

comment:1 Changed 11 years ago by Markus.Staab

the input field in your testcase should have the name "blah", not name.

comment:2 Changed 11 years ago by flesler

Component: coreselector
need: PatchTest Case
Resolution: invalid
Status: newclosed

Right, I'll close for now.

Reopen this if you modify the test case and it still fails.

comment:3 Changed 11 years ago by vlad

Resolution: invalid
Status: closedreopened

Guys, thank you for the awesome library!

This specific bug hits me big time and as I deal with the code form other developers, which I have limited access to, it makes it worse.

See the attached bug file - it works without the form, while failing with the form. The query has nothing to do with the form! In my case, the form is someone else's code!

The way to debug the problem is the following (my page is huge, so can not do it by breakpoints):

In jquery-1.2.6.js, after the following text at lines 1709 - 1711:

  if ( z == null || /href|src|selected/.test(m[2]) )
    z = jQuery.attr(a,m[2]) || '';

Insert the debug catcher:

  if (z !== z.toString()) {
    $(z).addClass('bug3167');
    z = z.toString();
  }

Then, in the FireFox console, look for the elements $('.bug3167')

By the way, just brutally adding the line

  z = z.toString();

, instead of the debug catcher after line 1711, saves it from aborting on 1717 (now 1718). Now, I think it is OK in my environment, but getting a proper fix would make me much more willing to release the code to production.

Changed 11 years ago by vlad

Attachment: jqselecttest.html added

Demo of selector failing on an unrelated to the selection elements

comment:4 Changed 11 years ago by flesler

Cc: hkirsman flesler added
Owner: set to flesler
Status: reopenednew

Yes, I think I saw this on another ticket. I pulled out the perfect solution, but it hits perfomance. Will handle this once I get a while.

comment:5 Changed 11 years ago by flesler

Cc: flesler removed
Status: newassigned

comment:6 Changed 11 years ago by vlad

I have mentioned this bug in the 1.3b1 bug #3753. Both bugs work off of the same test case but address different problems.

comment:8 Changed 9 years ago by dmethvin

Resolution: fixed
Status: assignedclosed

Test case does not throw an error with 1.3 or 1.4.

Note: See TracTickets for help on using tickets.