Hi,

Just wanted to say maybe adding a sorting by ALpha through the block would be a nice addon.

I've added the following like to the code to make it work.

OLD:

/**
 * Implementation of hook_allowed_values().
 */
function blockreference_allowed_values($field) {
  $options = _blockreference_potential_references($field, TRUE);
  
  foreach ($options as $key => $value) {
    $options[$key] = _blockreference_item($field, $value);
  }
  if (!$field['required']) {
    $options = array(0 => '<'. t('none') .'>') + $options;
  }
	
  return $options;
}

NEW:
OLD:

/**
 * Implementation of hook_allowed_values().
 */
function blockreference_allowed_values($field) {
  $options = _blockreference_potential_references($field, TRUE);
  
  foreach ($options as $key => $value) {
    $options[$key] = _blockreference_item($field, $value);
  }
+  array_multisort(array_map('strtolower', $options), $options);
  if (!$field['required']) {
    $options = array(0 => '<'. t('none') .'>') + $options;
  }
	
  return $options;
}

Comments

danielb’s picture

Status: Active » Fixed

done, thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.