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

CommentFileSizeAuthor
#4 webform_zero_export.patch492 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Thanks, 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.

quicksketch’s picture

The readable option is not displayed on the form or when viewing a submitted form.

To 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.

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.

This problem affects both D6 and D7.

quicksketch’s picture

The readable option is not displayed on the form or when viewing a submitted form.

This is a D7 core bug. It's being fixed in #866292: '0' not displayed as checkbox / radios options (nor as any element #title)

quicksketch’s picture

Title: Integer 0 as "safe_key|Some readable option" not displayed in the form » Zero integers not exported in CSV/Exel downloads.
Status: Active » Fixed
FileSize
492 bytes

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.

This 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.

Kleve’s picture

To 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.

Sorry about that, my mistake.

Great work!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.