Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#14422 closed defect (fixed)

TreeStoreModel incorrectly imports dojo/json, leads to json.stringify "undefined method"

Reported by: Nick Fenwick Owned by: bill
Priority: high Milestone: 1.8
Component: Dijit Version: 1.7.0
Keywords: Cc:
Blocked By: Blocking:


1.7.0 has TreeStoreModel?.js list in its define dependencies:

 	"dojo/_base/json", // json.stringify

This should be

	"dojo/json", // json.stringify

See attached test case.

According to kgf this also applies to ObjectStoreModel? on trunk (not in 1.7.0).

Attachments (1)

14422.html (1.2 KB) - added by Nick Fenwick 10 years ago.
test case

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by Nick Fenwick

Attachment: 14422.html added

test case

comment:1 Changed 10 years ago by bill

Owner: set to bill
Status: newassigned

Thanks. I'll fix, although I don't see a need to fix on the 1.7 branch, since you only hit that code when there's an error in your code... Actually come to think of it I don't want to pull in dojo/json just to make a throw Error more descriptive.

comment:2 Changed 10 years ago by Kenneth G. Franqueiro

Given that this is a bug born in the 1.7 release (and is technically a regression since the same behavior existed and worked in 1.6), I don't see why this should not be fixed in 1.7 branch. Maybe it's not something that needs to be rushed into 1.7.1 which we just cut RC for since it's quite rare, but something that should be fixed in 1.7 nonetheless.

If you'd like to take out the dojo/json dependency altogether instead though, I'll leave that to your discretion.

comment:3 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

In [27349]:

Remove superfluous dependency of dojo/json, which was mistyped as dojo/_base/json, fixes #14422 !strict.

comment:4 Changed 10 years ago by Nick Fenwick

Nit-pick mode on. New TreeStoreModel? error message doesn't cater well for when zero items were returned (as in my case where I mistype my query so it returns no items)

Old string: this.declaredClass + ": query " + json.stringify(this.query) + " returned " + items.length + " items, but must return exactly one item");

New text:"dijit.tree.TreeStoreModel: root query returned multiple items"

Suggest it should read "root query did not return exactly one item".

comment:5 Changed 10 years ago by bill

In [27350]:

Fix wording on throw, refs #14422 !strict.

comment:6 Changed 10 years ago by bill

In [27445]:

Fix wording on throw again, refs #14422 !strict.

Note: See TracTickets for help on using tickets.