I've just discovered the hook_taxonomy and it works fine to add actions on various taxonomy operations.

But, if I would like to add module specific validation to the edit term form (admin/taxonomy/edit/term/TID), hook_taxonomy doesn't seeems to be of any help.

Any sugestions on how I can achive this?

Comments

CloudCuckoo’s picture

Use hook_form_alter to add a validate hook that calls module_name_taxonomy_form_term_validate

function module_name_form_alter($form_id, &$form) {
   if ($form_id == 'taxonomy_form_term'){
      $form['#validate']['module_name_taxonomy_form_term_validate'] = array();
    }
}

See also:
Drupal Dojo lesson 3
http://groups.drupal.org/node/2403 for an example of custom validation