Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7100 closed defect (fixed)

dojox.data.FileStore: _processItem fails when querying for a non-existant path

Reported by: nathan Owned by: nathan
Priority: high Milestone: 1.2
Component: DojoX Data Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:

Description

Because the callback still fires, calling fetchItemByIdentity with a non-existant path will fail with the error "item is not defined"

Change History (6)

comment:1 Changed 11 years ago by nathan

Resolution: fixed
Status: newclosed

Fixed in [14216]

comment:2 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: closedreopened

Nathan, I do not think this fix is correct. onItem can be called with null/undefined for non-existant items according to spec.

From the spec:

The *onItem* parameter. Function(item) The onItem parameter is the callback to invoke when the item has been loaded. It takes only one parameter, the item located, or null if none found.

So I believe your fix actually breaks spec by no longer calling onItem with a null.

Where were you hitting a problem? Do you have a test that demonstrates it? It was likely a usage error of fetchItemByIdentity.

comment:3 Changed 11 years ago by Jared Jurkiewicz

In other words, your onItem is expected to check the parameter for null/undefined

comment:4 Changed 11 years ago by nathan

OK - I'm fine with checking for null/undefined in my onItem - I'll roll back the first part of this fix. The second part (where I check for item and return null) is where I was having problems, and was actually the issue with _processItem failing.

comment:5 Changed 11 years ago by Nathan Toone

Resolution: fixed
Status: reopenedclosed

(In [14225]) Fixes #7100 - for fetchItemByIdentity, onItem should be called with null

comment:6 Changed 11 years ago by Jared Jurkiewicz

Thanks for the fixes, btw! :-)

Note: See TracTickets for help on using tickets.