To reproduce through Webform module:

- Enable Webform and Options Element
- Create a new webform node
- Add a new "Select options" component
- Add 3 options (one,two,three), without custom keys, and set the second one to the default.
- Make sure "Multiple" is not checked
- The default value saved for the component is "two", instead of the actual key "1".
- Edit the component or view the form, you'll see that no default is set, since "two" is not a valid key.

The solution is just to run the default value through _form_options_search(), like we already do for multiple values.

Comments

quicksketch’s picture

Status: Needs review » Fixed

Committed.

tobiasb’s picture

Status: Fixed » Needs review

http://drupal.org/cvs?commit=416494

dsm($element_options);
quicksketch’s picture

Status: Needs review » Fixed

Oh dear! I must have accidentally had a Webform file selected when I committed from my IDE. Thanks tobiasb!

Status: Fixed » Closed (fixed)

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