You are here

function mvf_entityreference_selection_target_bundles_validate in Measured Value Field 7

Element validation function.

Make MVF unit subfield configuration element to follow expected values format in entity reference. We change bundle filter in entity reference from checkboxes to radio buttons, this validation function converts values returned by radios to look like they were returned by checkboxes.

1 string reference to 'mvf_entityreference_selection_target_bundles_validate'
EntityReference_SelectionHandler_Generic_units_unit::settingsForm in includes/EntityReference_SelectionHandler_Generic_units_unit.class.inc
Implements EntityReferenceHandler::settingsForm().

File

./mvf.module, line 1902
Define a field type of measured value.

Code

function mvf_entityreference_selection_target_bundles_validate(&$element, &$form_state, $form) {
  $value = array(
    $element['#value'] => $element['#value'],
  );
  $element['#value'] = $value;
  form_set_value($element, $element['#value'], $form_state);
}