Opened 7 years ago

Last modified 2 years ago

#13357 assigned defect

ObjectStore: isItem(item) could also test for identity

Reported by: Simon Speich Owned by: dylan
Priority: high Milestone: 1.15
Component: Data Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Checking if object is a data.store.item in ObjectStore.isItem() could also use getIdentity(item) to determine if it belongs, e.g:

return (typeof item == 'object') && item && !(item instanceof Date) && this.getIdenty(item);

Change History (6)

comment:1 Changed 7 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Kris Zyp

comment:2 Changed 7 years ago by bill

Description: modified (diff)

I'm not following the point of this ticket. Is there a bug in the current code?

comment:3 Changed 7 years ago by Simon Speich

Sorry, I guess I should have set this as an enhancement instead of bug. In the comment to isItem() on line 96 it says:

// we have no way of determining if it belongs, we just have object returned from
// 	service queries
return (typeof item == 'object') && item && !(item instanceof Date);

I suggested to add this.getIdentity(item) as an additionally check. I came across this because the tree.dndSource uses model.isItem() see ticket http://bugs.dojotoolkit.org/ticket/13356

comment:4 Changed 7 years ago by bill

Ah OK, it does sound like a bug then, that isItem() returns true for pretty much everything. Of course the getIdentity() approach will only work if the underlying store supports that API.

comment:5 Changed 3 years ago by dylan

Milestone: tbd1.12
Owner: changed from Kris Zyp to dylan
Status: newassigned

comment:6 Changed 2 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.