Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
field_ui_widget_type_form() should order the widgets it presents in the select dropdown.
Alternatively, field_ui_widget_type_options() should return them ordered, but that function is missing docs (#1598730: Several functions in field UI module (field_ui.admin.inc) are missing @param documentation) so it's hard to tell what it's meant to be doing.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1598748.field_ui_widget_type_options_sorting.patch | 793 bytes | rszrama |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedThis has been fixed in Drupal 8 in WidgetPluginManager::getOptions(). For Drupal 7, it seems the appropriate place is field_ui_widget_type_options(). I didn't bother trying to add comments to this function, as it's just as hard for me to sort out. I did confirm the attached patch fixes the sorting issue, though. :-/