I'm loving the new conditional features of the module, but I just tried exporting to CSV for the first time from my new big conditional survey and it appears that the export is missing placeholders for the questions that have dependencies and weren't answered by the respondent.
This is tough to illustrate, but I'll try my best. I've attached the exported XLS file to this issue. You can probably tell that in the last set of questions (Archery Experience, etc.) these questions are conditional and depend up which sports the user was interested in in the previous page of the webform. The problem, however, is that the responses for these last questions are displayed one right after the next and aren't positioned in the correct columns. I think we're just missing placeholders for the questions that the user wasn't expected to answer.
I'll take a look and see if I can figure out where that needs to take place w/in the module. Just wanted to be sure to go ahead and file an issue for it.
Comment | File | Size | Author |
---|---|---|---|
#8 | webform_csv_conditional.patch | 1.79 KB | quicksketch |
#5 | webform-6.x-3.0-beta5-conditional-export-csv2.patch | 783 bytes | attheshow |
#1 | webform-6.x-3.0-beta5-conditional-export-csv.patch | 687 bytes | attheshow |
assessment_of_students_athletic_interests_and_abilities.xls | 31.68 KB | attheshow |
Comments
Comment #1
attheshow CreditAttribution: attheshow commentedOh, ok, I think I found it actually. Here's a patch.
Comment #2
quicksketchThanks, I'll need to review this and try to figure out what that IF statement is trying to accomplish. It was clearly put in there for some particular reason, it doesn't seem right that we'd just be able to remove an entire conditional. It surely had or has some purpose for being in there.
Comment #3
attheshow CreditAttribution: attheshow commentedYeah, I figured it probably did too, but wasn't able to determine what the purpose was. Thanks for looking at this.
Comment #4
quicksketchHmmm, upon investigating this problem, that line doesn't even have the code that you've removed. It seems that your module may have been hacked and is no longer a stock installation.
This line is already what you're suggesting and has never been changed since beta 1. See http://drupalcode.org/viewvc/drupal/contributions/modules/webform/includ...
Comment #5
attheshow CreditAttribution: attheshow commentedSorry, looks like my diff was accidentally done in reverse. Here's the correct patch:
Comment #6
quicksketchIt looks to me like this patch will have the odd side-effect of causing elements that don't add values to the CSV download (but can be used with conditional) add empty columns to the CSV. This includes things like page breaks and fieldsets.
Comment #7
quicksketchThis patch takes a different approach, where we check hook_webform_component_info() and simply ask if a component supports CSV downloads. Regardless of whether that component decides to actually put anything into the CSV, a column is always added for that component.
Comment #8
quicksketchPatch for above comment
Comment #9
quicksketchI've tested this patch but I couldn't actually reproduce the problem described with or without it applied. However it should solve the problem because the approach is similar to what was suggested in #5. Regardless of a field returning a value, it will get a column.
I also like this improvement because it means that any module can implement hook_webform_component_info_alter() and set 'csv' to FALSE to disable CSV functionality for any component. I've committed this patch so we can get out a beta 6 release.
Comment #10
attheshow CreditAttribution: attheshow commentedGreat. Thanks for your help! I'll check out the new beta.