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.
When use SELECT with
<Basic Prague Walks>
0|The Best of Prague Tour
1|Right River Bank Tour
<Non-traditional Prague>
2|Prague Underground
3|Prague Legends
<Trips outside Prague>
4|Kutna Hora
5|Karlovy Vary
in E-mail shows only safe_key
You are booking the tour: 3
+ when I select first option, it shows nothing in e-mail.
Like
You are booking the tour:
When use no in select
0|The Best of Prague Tour
1|Right River Bank Tour
2|Prague Underground
3|Prague Legends
4|Kutna Hora
5|Karlovy Vary
in E-mail it shows "readable value" correctly
You are booking the tour: Prague Legends
+ when select first option works fine too:
You are booking the tour: The Best of Prague Tour
There in some problem with GROUPS isnt it?
Comment | File | Size | Author |
---|---|---|---|
#7 | webform_zero_checkbox-d7.patch | 969 bytes | quicksketch |
#5 | webform_select_forwardport.patch | 9.37 KB | quicksketch |
#4 | webform_select_forwardport.patch | 8.32 KB | quicksketch |
#3 | webform-select-group-theming-1180454-3.patch | 1.46 KB | tobyontour |
Comments
Comment #1
quicksketchThanks for the report! I'll look into this next time I'm working on Webform.
Comment #2
timb CreditAttribution: timb commentedI am also experiencing troubles with groups in select lists. For me when using groups in a multi-select no values are sent in email or recorded to submissions.
When taking the groups out the form works fine.
Comment #3
tobyontour CreditAttribution: tobyontour commentedThe problem seems to be that when converting the safe_key back to the readable value the code doesn't take into account that the options array is an extra level deep (and so ends up looking for the safe_key in the array level where the keys are group names).
Here is a patch that fixes it (apologies for it being slightly old-skool, but I don't have ssh/git access at work).
Comment #4
quicksketchApparently all of #762574: Select and grid components show key (or nothing) instead of values in emails, CSV, table, etc. somehow did not make it into the 7.x branch, so this problem (and several others) are fixed in D6 but not D7. Forward-porting all the changes fixes this issue with e-mail keys breaking when nested and it also fixes the display of "Table" view under the Analysis tab.
Comment #5
quicksketch#762574: Select and grid components show key (or nothing) instead of values in emails, CSV, table, etc. also included a small change to grid.inc to fix its table display. Including that here also.
Comment #6
quicksketchI've committed this patch to the 7.x-3.x branch.
Comment #7
quicksketchMy patch caused a test failure because Drupal 7 returns an integer 0 for checkboxes that are not checked, instead of FALSE like Drupal 6. This patch fixes the mistake.