For webform module's built-in select component there is a hard-coded option key length limit at value 128. If I use an option key larger than 128 bytes, I get validation error Option keys must be less than 128 characters.
This behaviour is defined in file components/select.inc in function _webform_edit_validate_select().
I don't see any reason why this restriction is in effect. There is a question on Stack Overflow about the max key size for an array in PHP. It turns out that even a key of 128 MB (!) causes no problem.
Besides the limitation, it would be a good practice to allow the user to change the limit value.
Comments
Comment #1
quicksketchI don't think this is a large enough issue to cause any problems. It's easy enough to simply use a shorter key. I'm changing this to a feature request.
Comment #2
nyuhuhuu commentedI may choose short option keys for my values but that binds the interpretation of data to the application logic.
There are certain cases where key and label are the same, they both mean the value.
I'd like to store pure values in the database so my data can be understood even when using a simple SQL query. I use the Options form component to limit the possible answers to the question may be given by the user and I do need the raw answer to be stored just like it was typed in a textfield.
Storing computed option keys that differs from the option values (labels) may prevent loading the database into a different application otherwise it is needed to code again the option key-label mapping in application level.
If currently there is no known issue why this limitation is in effect, removing it will improve the module's usability.
Comment #3
danchadwick commentedThere won't be further feature development in the X.x-3.x branches.