Opened 8 years ago

Closed 8 years ago

#13888 closed defect (fixed)

ServiceStore gets except on getValues(item, attr) when attr not defined

Reported by: Jean-Rubin Leonard Owned by: Kris Zyp
Priority: high Milestone: 1.7
Component: Data Version: 1.6.1
Keywords: dijit tree empty no children animation freeze Cc:
Blocked By: Blocking:

Description

If we have a treenode in the tree (one that has mayHaveChildren return tree, therefore could potentially have a children) that has no children and we try to open it. It gets stuck in the animation, and errors out with the message "args.item is undefined". Once upon a time the behavior was to just open the node to an empty content and I'm being told that it's the behavior it should still have. This is therefore a bug. Find a test file attached.

Attachments (1)

testTree.zip (1.9 KB) - added by Jean-Rubin Leonard 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Jean-Rubin Leonard

Attachment: testTree.zip added

comment:1 Changed 8 years ago by bill

Resolution: invalid
Status: newclosed

There's a typo in your test case where it tries to load a root of "testTreeRoot2", yet your only data file is called "treeTestRoot2". But after fixing that, I can see the real problem is that your leaf nodes don't have children: [] attributes, and that confuses the ServiceStore code when Tree queries to find the children of those items.

There are provisions in ServiceStore for deferred loading of items. However, your test case doesn't have that setup. It would need to do deferred loading which would create the empty array children attribute.

Last edited 8 years ago by bill (previous) (diff)

comment:2 Changed 8 years ago by bill

Component: DijitData
Resolution: invalid
Status: closedreopened
Summary: Treenode with no children is stuck in the animation when we try to pen it.ServiceStore gets except on getValues(item, attr) when attr not defined

Actually, this is a bug in ServiceStore (the base class for JsonRestStore). TreeStoreModel calls ServiceStore.getValues({node_id: 65}, "children"), which according to spec should return [] since there's no children attribute for that item. But instead it gets an exception.

comment:3 Changed 8 years ago by bill

Owner: set to Kris Zyp
Status: reopenednew

comment:4 Changed 8 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

In [26552]:

Remove unnecessary load attempt, fixes #13888 !strict

comment:5 Changed 8 years ago by bill

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