Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10061 closed bug (duplicate)

$.data fais in case of retrieving data from a dom element which is no longer in jQuery.cache

Reported by: [email protected] Owned by: [email protected]
Priority: low Milestone:
Component: data Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

The issue is described here http://www.datatables.net/forums/discussion/5644/issues-when-removing-datatables-from-the-dom-on-ie8/p1 It rather knotty but in short $.data fails when jquery-ui tries to trigger a "remove" event in it's own overridden $.cleanData function and fails on element which was already removed. This precondition looks like an invalid case, but the fix on jQuery side is pretty straight forward. In line 1455 of full 1.6.2 sorces there is an if condition

if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
			return;
		}

there cache[ id ] is undefined so !cache[ id ][ internalKey ] fails with NPE. Is it possible to add additional && cache[ id ] check before !cache[ id ][ internalKey ]?

Change History (5)

comment:1 Changed 10 years ago by addyosmani

Component: unfileddata
Owner: set to [email protected]
Priority: undecidedlow
Status: newpending

Thanks for submitting a ticket. Could you provide us with a reduced test case replicating the behaviour mentioned on jsFiddle so we can investigate further?

comment:2 in reply to:  1 Changed 10 years ago by [email protected]

Status: pendingnew

Replying to addyosmani:

Thanks for submitting a ticket. Could you provide us with a reduced test case replicating the behaviour mentioned on jsFiddle so we can investigate further?

Please, here you are http://jsfiddle.net/dbdkN/8/ Fails in IE8. After you run the example press "Reinit Table" button. A error will be thrown: Line: 1455 Error: 'undefined' in null or not an object

comment:3 Changed 10 years ago by Rick Waldron

Milestone: None1.6.3
Resolution: duplicate
Status: newclosed

comment:4 Changed 10 years ago by Rick Waldron

Duplicate of #8235.

comment:5 Changed 10 years ago by dmethvin

Milestone: 1.6.3
Note: See TracTickets for help on using tickets.