You are here

function crm_core_contact_merge_contacts_action_validate in CRM Core 7

Validate handler for action configuration form.

File

modules/crm_core_contact/crm_core_contact.module, line 1152
Provides default CRM Core Contact entities and the ability to create more.

Code

function crm_core_contact_merge_contacts_action_validate($form, $form_state) {
  $table = $form_state['values']['table'];
  $primary_contact = array_filter($table['contact_id']);
  if (empty($primary_contact)) {
    form_set_error('table][contact_id', t('You must select primary contact in table header!'));
  }
  if (count($primary_contact) > 1) {
    form_set_error('table][contact_id', t('Supplied more than one primary contact!'));
  }
}