You are here

function entityreference_prepopulate_providers_validate in Entityreference prepopulate 7

Element validate; Set the value of the providers.

1 string reference to 'entityreference_prepopulate_providers_validate'
EntityReferencePrepopulateInstanceBehavior::settingsForm in plugins/behavior/EntityReferencePrepopulateInstanceBehavior.class.php
Generate a settings form for this handler.

File

plugins/behavior/EntityReferencePrepopulateInstanceBehavior.class.php, line 175

Code

function entityreference_prepopulate_providers_validate($element, &$form_state) {
  $value = $form_state['values']['instance']['settings']['behaviors']['prepopulate']['providers']['enabled'];

  // Sort the value by the weight.
  uasort($value, 'drupal_sort_weight');
  form_set_value($element, $value, $form_state);
}