Hello!

I believe I've run into a bug in Webform's CSV export functionality, particularly when dealing with select fields that (a) allow multiple selections, and (b) include groupings in the Options field. The resulting CSV file includes headers for the option groupings, but not for the options themselves, resulting in missing data.

To reproduce, try creating two "select" components in a Webform, each allowing the user to select multiple values. On the first, enter a set of options without groups, i.e.:

Apples
Oranges
Broccoli
Carrots

On the second, enter the same option set with groupings:

<Fruit>
Apples
Oranges
<Vegetables>
Broccoli
Carrots

Submit the form a few times to get some test data going; then, download a CSV or TSV export of the data. I did this test myself with about five form submissions; each time, I submitted identical value sets for each field. The CSV results are attached (as a TXT file; I had to change the extension to upload it here); as you can see, the "favorites1" field (without option groupings) has all its data intact, but the "favorites2" field (with option groupings) only lists the option groupings as values, and none of the data.

Is this the expected behavior? Or is there a setting I'm missing that will allow the missing data through to the CSV export?

Thanks!

Comments

quicksketch’s picture

Thanks, you're dead-on. The CSV export functionality didn't get updated when we added field groups. It looks like the analysis functionality might not be updated either. I'll see what we can do to correct these. Thanks for the great report!

quicksketch’s picture

Status: Active » Needs review
StatusFileSize
new1.86 KB

Here's a patch that should fix the problem, you can use the manual on applying patches (http://drupal.org/patch/apply) to try it out. We don't preserve the actual "groupings" in the CSV download, for one because no data is never entered as a group value and second because we don't have anywhere to put it in the CSV anyway.

quicksketch’s picture

Status: Needs review » Fixed

I went ahead and committed as I'm trying to get out a 2.5 release. Please reopen if you have further questions.

Status: Fixed » Closed (fixed)
Issue tags: -export, -grouping, -CSV, -multiple values

Automatically closed -- issue fixed for 2 weeks with no activity.