Alphabetize the array

Created on 3 October 2012, over 12 years ago
Updated 25 June 2025, 8 days ago

The array was coming back un-alphabetized. So I added an asort()

function _multiple_selects_get_options($field, $instance, $properties, $entity_type, $entity) {
  // Get the list of options.
  $options = (array) module_invoke($field['module'], 'options_list', $field, $instance, $entity_type, $entity);

  // Sanitize the options.
  _options_prepare_options($options, $properties);

  if (!$properties['optgroups']) {
    $options = options_array_flatten($options);
  }
  
//a sort alphabetizes by entity title
 asort($options);
  
 
  if ($properties['empty_option']) {
    $label = theme('multiple_selects_none', array('instance' => $instance, 'option' => $properties['empty_option']));
    $options = array('_none' => $label) + $options;
  }

  return $options;
}
✨ Feature request
Status

Closed: won't fix

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jmart

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024