Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13206 closed defect (fixed)

[patch][ccla] dojo.store.Observable does not send correct put notification when the put object ID is 0

Reported by: cjolif Owned by: Kris Zyp
Priority: high Milestone: 1.7
Component: Data Version: 1.7.0b1
Keywords: Cc: Kris Zyp
Blocked By: Blocking:

Description

See attached test case. When the id property of a data item is 0, the notification it has been modified is not correctly sent by Observable. More particularly the previousIndex attribute is set to -1 instead of the actual index of the element.

This comes from a test in Observable that test id existence this way:

if(existingId){..

while it should be:

if(existingId != undefined){

I have attached a patch that does this.

Attachments (2)

dojo.store.Observable.id0.patch (589 bytes) - added by cjolif 8 years ago.
patch
PutFirstItemTest.js (1.1 KB) - added by cjolif 8 years ago.
test case

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by cjolif

patch

Changed 8 years ago by cjolif

Attachment: PutFirstItemTest.js added

test case

comment:1 Changed 8 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Kris Zyp

comment:2 Changed 8 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

(In [25509]) Fixes handling of falsy ids, fixes #13206 !strict

comment:3 Changed 8 years ago by bill

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.