Steps to reproduce:
- Create a new field (for a content type) of type List (text).
- Fill in some values.
- Leave the checkbox "Custom keys" unchecked.
before
- Press save.
- Result: the field settings for the just created field are shown, including the entered values but now with a numeric key

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fietserwin’s picture

Issue summary: View changes
quicksketch’s picture

This is the default and intended functionality of the module. Numeric keys are always used unless strings are manually specified, since there's no way we could establish reasonable keys based on the user-provided input for options.

fietserwin’s picture

Then I don't get it. Why can't the values be used as key like in the original form? It is a text field, not a numeric field and any key is allowed as far as html is regarded. for storage there is only a limit on the length (256).

quicksketch’s picture

Hmm, it's possible to switch to using the values as the keys as well, we'd just switch to #key_type = 'associative' in _options_element_add_allowed_values_element(). Though maybe it should stay 'mixed' for number-based select lists and 'associative' for string-based ones.

gcb’s picture

Status: Active » Needs review
FileSize
619 bytes

Yep, that help. Here's a patch for exactly that.