#7403 closed defect (fixed)
jsonPathStore: parentItem is not defined
Reported by: | haysmark | Owned by: | Dustin Machi |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | DojoX Data | Version: | 1.1.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In 1.1.1, a Grid user was reporting problems with deleting items from a jsonPathStore. Although the user for some reason couldn't load the uncompressed Dojo build into the application to figure out exactly where the problem was, between the reference to parentItem in the error and the signature of the functions in the stack as reported by Firebug, we did trace the problem to jsonPathStore's deleteItem. In particular, this code looks suspicious:
if(parentItem && parentItem[attribute] && !dojo.isArray(parentItem[attribute])){ this._setDirty(parentItem); this.unsetAttribute(parentItem, attribute); delete parentItem[attribute]; } if (dojo.isArray(parentItem[attribute])){
What if parentItem[attribute] gets deleted by the first block? Or worse, what if there was no parentItem to begin with? Then the second if will definitely throw an error. Basically, I'm hoping someone more knowledgeable of the code will try deleting an item defined by {} and not [] that has no parentItem.
Assigned to Jared so hopefully he can give a prognosis and delegate it to the store's committer.
Change History (7)
comment:1 Changed 13 years ago by
Owner: | changed from Jared Jurkiewicz to kriszyp |
---|
comment:2 Changed 13 years ago by
Owner: | changed from kriszyp to Dustin Machi |
---|
comment:3 Changed 12 years ago by
Milestone: | tbd → 1.3 |
---|
comment:4 Changed 12 years ago by
Milestone: | 1.3 → 1.4 |
---|
comment:5 Changed 11 years ago by
Milestone: | 1.4 → future |
---|
comment:6 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [20831]) jsonPathStore is out of sync due to the more advanced dojox.json capabilities. To avoid confusion with these, I'm removing this widget as I dont' plan to support it going forward. There is an equivalent widget which uses dojox.json ref and query in dojoc/dmachi/data called JsonStore? for those who still need this capability. While they are not drop in replacements of each other, they are pretty close and it should not take a significant amount of time to convert, and the benefits gained in performance and querying flexibility are worth it. closes #7473 closes #8175 closes #7331 closes #7403 closes #8312 closes #8334 closes #9976 closes #10290
comment:7 Changed 11 years ago by
Milestone: | future → 1.4 |
---|
Owners should mark these bugs w/a milestone (possibly future). Putting into 1.3 milestone temporarily (since 1.2RC has already been made)