You are here

function taxonomy_dupecheck_term_validate in Taxonomy dupecheck 7

Same name and namespace in other branches
  1. 6 taxonomy_dupecheck.module \taxonomy_dupecheck_term_validate()

Implements _form_validate() for taxonomy_form_term().

1 string reference to 'taxonomy_dupecheck_term_validate'
taxonomy_dupecheck_form_taxonomy_form_term_alter in ./taxonomy_dupecheck.module
Implements hook_form_FORM_ID_alter() for taxonomy_form_term().

File

./taxonomy_dupecheck.module, line 124
Module file for the Taxonomy dupecheck module.

Code

function taxonomy_dupecheck_term_validate($form, &$form_state) {
  $term = $form_state['values']['name'];
  $vid = $form_state['values']['vid'];
  $tid = $form_state['values']['tid'];
  if (taxonomy_dupecheck_is_dupe_term($term, $vid, $tid)) {
    form_set_error('name', t('The term %term already exists in this vocabulary.', array(
      '%term' => check_plain($term),
    )));
  }
}