#9332 closed defect (fixed)
ItemFileReadStore: deserialize fails when _value = 0
Reported by: | drcoelho | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | blocker | Milestone: | 1.4 |
Component: | Data | Version: | 1.3.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If a value _value is set to 0, the deserialize function is not called properly, and an invalid deserialized value is returned. In a grid, instead of getting a deserialized value, one would get '[object Object]' displayed.
dojo/data/ItemFileReadStore.js has the following test:
if (value._type && value._value) { ...
which should be changed to:
if (value._type !== null && value._value !== null) { ...
to avoid bypass of deserialize call when _value=0. Diff of changes required to fix this bug are included in attachment.
Attachments (3)
Change History (12)
Changed 13 years ago by
Attachment: | ItemFileReadStore.diff added |
---|
comment:1 Changed 13 years ago by
Actually, the checks should be !=, so that both null and undefined are caught.
comment:2 Changed 13 years ago by
Actually, there's a better check, such as (if ((_type in value) && (_value in value)), which makes sure they're defined and can have any value. Need to experiment with these and pick one.
comment:3 Changed 13 years ago by
Added a patch that lets _value be anything from explicit undefined, null, 0, false, "", etc, without causing a problem with it deserializing. Added in UT for it as well.
Changed 13 years ago by
Attachment: | customTypes_IFS.patch added |
---|
comment:4 Changed 13 years ago by
comment:5 Changed 13 years ago by
Changed 13 years ago by
Attachment: | customTypes_AndOr.patch added |
---|
comment:6 Changed 13 years ago by
comment:8 Changed 13 years ago by
Milestone: | tbd → 1.4 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
diff for ItemFileReadStore?.js showing patch to fix bug