#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: |
Description
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)
Change History (7)
Changed 9 years ago by
Attachment: | 14422.html added |
---|
comment:1 Changed 9 years ago by
Milestone: | 1.7.1 → 1.8 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
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 9 years ago by
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:4 Changed 9 years ago by
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".
test case