If you create the type "select" with the integer 0 as "safe_key|Some readable option" for your select options, the "readable option" is not displayed on the form.
eg. if you enter the following as options for the select type:
0|0
1|1
The readable option is not displayed on the form or when viewing a submitted form. Also if you download it as excel, the readable option is not displayed. The same problem exist if you download it with the keys instead of the readable option.
When viewing the "Analysis" page, the readable option is displayed. Shouldn´t also the form display this?
If you add a space to the "safe_key|Some readable option" everything displays as it should:
0 | 0
1 | 1
Comment | File | Size | Author |
---|---|---|---|
#4 | webform_zero_export.patch | 492 bytes | quicksketch |
Comments
Comment #1
quicksketchThanks, I've confirmed this problem. We've got a ton of tests around "0" handling, but they only check that the value is recorded, not that a 0 is displayed to the user. Thanks for the report.
Comment #2
quicksketchTo be clear, using the "View" option shows the value "0", using "Edit" on a submission is what doesn't show the "0" value. This problem only affects the D7 version.
This problem affects both D6 and D7.
Comment #3
quicksketchThis is a D7 core bug. It's being fixed in #866292: '0' not displayed as checkbox / radios options (nor as any element #title)
Comment #4
quicksketchThis bug is solved by this patch, which I've committed to the project.
The other problem of zero labels not showing up will need to be solved by Drupal core.
Comment #5
Kleve CreditAttribution: Kleve commentedSorry about that, my mistake.
Great work!