function tripal_bulk_loader_edit_template_record_form_validate

2.x tripal_bulk_loader.admin.templates.inc tripal_bulk_loader_edit_template_record_form_validate($form, &$form_state)
3.x tripal_bulk_loader.admin.templates.inc tripal_bulk_loader_edit_template_record_form_validate($form, &$form_state)
1.x tripal_bulk_loader.admin.templates.inc tripal_bulk_loader_edit_template_record_form_validate($form, $form_state)

Implements hook_form_validate()

D7 @todo: Needs to be debugged

Related topics

File

tripal_bulk_loader/includes/tripal_bulk_loader.admin.templates.inc, line 1119
All functions in this file pertain to administrative management of bulk loader templates

Code

function tripal_bulk_loader_edit_template_record_form_validate($form, &$form_state) {

  // Don't worry about validation when Cancel button is clicked
  if ($form_state['clicked_button']['#value'] == 'Save Record') {
    $is_unique = tripal_is_bulk_loader_record_name_unique(
    $form_state['values']['record_name'], 
    $form_state['values']['template_id'], 
    $form_state['storage']['template_array'], 
    $form_state['values']['field_group']
    );
    if (!$is_unique) {
      form_set_error('record_name', "New Record Name must be unique. '" . $form_state['values']['record_name'] . "' is not unique.");
    }
  }

}