hook_form_alter function does not call the validate function? i'm creating a unique field module which restrict a user with specific role to create one node per year. it works first but after installing some modules Automatic Nodetitles, Cancel Button, Field Permissions, View profiles permissions, More Buttons Content my custom module does not work. its hook_form_alter function works but hook_form_validate function does not work.

function uniquefield_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'target_achieved_node_form' || $form_id ==  'target_node_form') {
    $form['#validate'][]  = 'uniquefield_form_validate';
  }
}
function uniquefield_form_validate($form, &amp;$form_state) {
  $user = user_load_by_name($form_state['values']['name']);
  if ($user) {
    if($form_state['values']['type'] == 'target_achieved' &amp;&amp;  in_array('vidyakjatha', $user-&gt;roles)) {
      $query = new EntityFieldQuery();
      $query-&gt;entityCondition('entity_type', 'node')
     -&gt;entityCondition('bundle', 'target_achieved')
     -&gt;propertyCondition('status', 1)
     -&gt;propertyCondition('uid', $user-&gt;uid , '=');
     if ($form_state['values']['nid'] != '')
       $query-&gt;propertyCondition('nid', $form_state['values']['nid'] , '&lt;&gt;');
       $query-&gt;fieldCondition('field_achieved_year', 'value', $form_state['values']['field_achieved_year'][LANGUAGE_NONE][0]['value'], '=');
       $result = $query-&gt;execute();
     if (isset($result['node'])) {
       form_set_error('field_achieved_year', t('You have already added target achived status for year !year.', array('!year' =&gt; date('Y', strtotime($form_state['values']['field_achieved_year'][LANGUAGE_NONE][0]['value'])))));
     }
   }
  }
}
as your validating just one field - at least, it seems like it; consider using:

function uniquefield_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'target_achieved_node_form' || $form_id ==  'target_node_form') {
    $form['your_desired_field']['#element_validate']  = array('uniquefield_validate');
  }
}


on the fileds in your alter hook