Test case:
1) I use a select component for send e-mails with this configuration:
mail1@mail.it,mail2@mail.it,id1|The first select value
mail1@mail.it,mail2@mail.it,id2|The second select value

2) Ten people compile the webform

3) Now I need to add an e-mail address for the select component so I change the configuration of the select like:
newmailxxx@newmailxxx.it,mail1@mail.it,mail2@mail.it,id1|The first select value
mail1@mail.it,mail2@mail.it,id2|The second select value

4) I go to the result section of webform

5) I find that is showed the key instead of the value for the component in the result for every user that selected the first select value (that has been changed).

I think this behavior is normal because the key of the select component must not change (in teory) but I don't know if it's a good idea to use mail addresses (that may change) as key.

Perhaps it's better to use only the "id" part (that has to be unique) in this string
newmailxxx@newmailxxx.it,mail1@mail.it,mail2@mail.it,id|The first select value
instead of the whole mail+id.

I hope my explanation is understandable. Someone has suggestions or think the same?

Comments

quicksketch’s picture

Status: Active » Closed (duplicate)

Yep, that's exactly why we shouldn't be using e-mail addresses to begin with. We're planning to provide a substitute in #687606: Add conditional email sending feature.

broyhill’s picture

Title: Select values are not shown if the key is modified » Select values are not shown in download file if the key|value pair is removed
Version: 6.x-3.9 » 6.x-3.11
Status: Closed (duplicate) » Active

My issue is similar to brennino's, but different enough that I am posting mine (I spent a couple hours going through the issue list, I swear!).

Here's my situation:

1) I use a select (drop-down list) component for accepting registrations to an event that has several dates:

0|Date 1
1|Date 2
2|Date 3

2) After a few weeks of use, My "Date 2" event is full, so I need to remove it from the select list. If I simply remove the key|value so it doesn't appear as a choice, my download file has changed "Date 2" to the key "1". In the old webform, this didn't happen, so this is frustrating to my Drupal users who are building these forms and downloading the data.

3) I have experimented with all the download options on webform-results/download; I really need to keep the human readable value in there, and I can't see how using "Separate" or "Compact" list formats would solve the problem.

3) The embarrassingly poor hack we are using is to simply change the value of "Date 2" to "Date 2 is FULL" so the end user doesn't select it.

So the question is how to remove a key|value pair without having the value replaced by the key in the download file? Or is there a way to hide one of the key|value pairs so it doesn't appear to the end user?

I realize this is not really a bug, but I'm just unable to find a solution to this particular problem.

quicksketch’s picture

Category: bug » support

If you remove the value from the select list, obviously Webform can't figure out what the human-readable value any more since Webform doesn't know what it is anymore. Webform does however still keep the "key" value (since that's what's in the database), and that should still be included in the downloaded CSV file. So a simple solution is just to use "Date 1" as both the key and value like this:

Date 1|Date 1
Date 2|Date 2
Date 3|Date 3
broyhill’s picture

Doh! Of course! Thanks so much. Never thought about changing the key that way.

quicksketch’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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