Posted by rjoy on November 8, 2010 at 10:21pm
4 followers
| Project: | Webform |
| Version: | 6.x-3.4 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi! I ran into an odd little problem today. When downloading results for MS Excel, if I choose the "separate" select list option, I will get the KEYS regardless of my selection under "select keys." The "compact" format works as expected when human-readable values are requested.
Out of curiosity, I also tried this with the delimited text export format, and it appears to have the same result. I've been able to duplicate this on a few different webforms which use the select component.
Thanks in advance for any help you can offer, and please let me know if there's more information I can provide.
Comments
#1
Thanks for the report, I'll take a look next time I'm going through the issue queue.
#2
I'm still testing, but it looks like if you replace line 664 ($headers[2][] = $key;) with the below code segment in compontents/select.inc, the full text is displayed.
if ($export_options['select_format'] == 'separate') {
$headers[2][] = $item;
} else {
$headers[2][] = $key;
}
I am currently working with version 6.x-3.4, not with the current dev version, so the line number may be different there. Unfortunately, it looks like my recent upgrade may have caused a data problem as well, so I'm not going to be able to create a patch until I get that fixed. If someone else has time to create a patch, please do.
#3
Note to self: Fully test before posting comments.
Try the below code segment instead of the one I posted a few minutes ago:
if ($export_options['select_keys']) {
$headers[2][] = $key;
} else {
$headers[2][] = $item;
}
#4
Here is a patch against HEAD.
This modifies the _webform_csv_headers_select() function.
#5
Thanks committed to both 3.x branches.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.