In the function webform_components, the components are sorted by key. When working in an other language than English, the order seems weird because it's not alphabetical.
The patch attached, sorts the components by the label that is shown in the select list.
| Comment | File | Size | Author |
|---|---|---|---|
| sort_components_alphabetically.patch | 973 bytes | jeroent |
Comments
Comment #2
danchadwick commentedNice. I simplified your code a touch. We require PHP 5.3, so we have anonymous functions. The testing for the presence of 'label' isn't needed as other code assumes it is defined. To not define it would be a bug in the component.
I doubt the "natural" part will ever matter, because component labels would not normally have digits. But I don't see the harm.
Committed to 7.x-4.x and 8.x.