You are here

function unique_field_node_settings_form_validate in Unique field 5

Same name and namespace in other branches
  1. 6 unique_field.module \unique_field_node_settings_form_validate()
  2. 7 unique_field.module \unique_field_node_settings_form_validate()

Form validation callback for unique_field_node_settings_form.

File

./unique_field.module, line 366
Provides content validation requirement that the node's title, author, or specified CCK fields are unique.

Code

function unique_field_node_settings_form_validate($form_id, $form_values) {
  if ($form_values['unique_field_scope'] == UNIQUE_FIELD_SCOPE_NODE) {
    if ($form_values['unique_field_comp'] == UNIQUE_FIELD_COMP_ALL) {
      form_set_error('unique_field_comp', t('The scope of a single node requires that each field must be unique.'));
    }
    if ($form_values['unique_field_fields'][UNIQUE_FIELD_FIELDS_AUTHOR] == UNIQUE_FIELD_FIELDS_AUTHOR) {
      form_set_error('unique_field_fields', t('The author field is not supported within the scope of a single node.'));
    }
  }
}