Opened 13 years ago
Closed 13 years ago
#4691 closed defect (fixed)
ItemFileReadStore.js: issues in _getItemByIdentity and _getItemsFromLoadedData
Reported by: | guest | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Data | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In ItemFileReadStore?.js, method _getItemByIdentity (line# 671), the else part is "this._arrayOfAllItems[identity];". Should it not be "item=this._arrayOfAllItems[identity];"?
Also, in the JSON data if I have not specified an "identifier", the instance object _itemsByIdentity is meant to be null and this assumption is used in the if condition of _getItemByIdentity (line# 665). But in the method _getItemsFromLoadedData (line# 488), _itemsByIdentity is instantiated whether "identifier" is available or not. Should this instantiation code be moved down one line, into the if condition?
Thanks & Regards, Ganesh Ravindran
Attachments (1)
Change History (7)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Milestone: | → 1.0 |
---|---|
Status: | new → assigned |
Actually, you were correct on the second one as well. There was a problem with the logic that did auto-assigning of identities if an identifier was not declared in the data set. Easy fix, adding UT for this as well. Thank you for catching that!
comment:3 Changed 13 years ago by
Well, hopefully an easy fix, anyway. Write store makes copious use that associative map. Rethinking this a bit...
comment:4 Changed 13 years ago by
Requiring changes to ItemFileReadStore?, ItemFileWriteStore?. At least 3 new UT for them as well.
Changed 13 years ago by
Attachment: | 20071015-ItemFileStore.patch added |
---|
Patch for Identity support in ItemFile?*Store.
comment:5 Changed 13 years ago by
Patch UT tested on:
Firefox 2.0.0.7 Firefox 1.5.0.12 Safari B3 IE 6 IE 7 Seamonkey 1.1.2 Opera 9.2
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Looking at the first one. There is probably something wrong there.
As for the second, ItemFileReadStore? always supports identity. If you don't specify an identity for an item, it assigns you one (basically the item current item count at the time the item is processed). So it should always initialize the array as it will always have values.