Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | webform-excel.patch | 624 bytes | retorque |
Comments
Comment #1
quicksketchThanks for the report, I'll take a look next time I'm going through the issue queue.
Comment #2
retorque CreditAttribution: retorque commentedI'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.
Comment #3
retorque CreditAttribution: retorque commentedNote 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;
}
Comment #4
retorque CreditAttribution: retorque commentedHere is a patch against HEAD.
This modifies the _webform_csv_headers_select() function.
Comment #5
quicksketchThanks committed to both 3.x branches.