Opened 10 years ago

Closed 10 years ago

#9738 closed defect (fixed)

CsvStore dies unless there are data rows

Reported by: Stefan Bird Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.4
Component: DojoX Data Version: 1.3.2
Keywords: CsvStore Cc:
Blocked By: Blocking:

Description

Currently, CsvStore? doesn't handle CSV files where there is a header row, but no data rows. Eg:

"Country","Capital City","Population"

This is because of the code on line 325: http://bugs.dojotoolkit.org/browser/dojox/trunk/data/CsvStore.js?rev=19903#L325

It does an unnecessary check on the length of arrayOfAllItems. If it is 0, items remains null, as set on line 293. The null is then passed to SimpleFetch?._fetchHandler, which breaks when it tries to access the length property (line 49).

Fix: Remove the unnecessary if statement on line 325. This will cause an empty array to be given to _fetchHandler, which is the expected behaviour since no data rows were returned by the server.

Attachments (1)

CsvStore.patch (2.3 KB) - added by Jared Jurkiewicz 10 years ago.
Patch + tests

Download all attachments as: .zip

Change History (4)

comment:1 Changed 10 years ago by Jared Jurkiewicz

Milestone: tbd1.4

Changed 10 years ago by Jared Jurkiewicz

Attachment: CsvStore.patch added

Patch + tests

comment:2 Changed 10 years ago by Jared Jurkiewicz

Fixed in: [19924]

comment:3 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.