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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Version: 8.x-dev » 7.x-dev
Status: Active » Needs review
FileSize
793 bytes

This 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. :-/