You are here

function redhen_fields_field_widget_error in RedHen CRM 7

Implements hook_field_widget_error().

File

modules/redhen_fields/redhen_fields.module, line 602
Defines email, phone and address field types for RedHen CRM.

Code

function redhen_fields_field_widget_error($element, $error, $form, &$form_state) {
  switch ($error['error']) {
    case 'redhen_fields_invalid_email':
      $error_element = $element['value'];
      break;
    case 'redhen_fields_multiple_default':
      $error_element = $element['default'];
      break;
    default:
      $error_element = $element;
      break;
  }
  form_error($error_element, $error['message']);
}