Custom error for user registration page in D7 not working I can't seem to figure out why this custom module refuses to execute for user registration validation. I've made sure I'm using the correct form id using firebug, verified the module is installed properly, but this module just refuses to show an error when the username is left blank during registration. 

I thought the issue might have to do with the theme I'm currently using (Venture Theme), but I'm not really sure how to check the theme to verify the id's weren't changed. Anyone have an idea why this code won't run properly?

&lt;?php
/**
* Implements hook_form_alter().
*/
function validation_form_user_register_form_alter(&amp;$form, &amp;$form_state) {
    $form['#validate'][] = 'validation_user_register_validate';
}

function validation_user_register_validate($form, &amp;$form_state) {
  if (empty($form_state['values']['name'])){
        form_set_error('name', t('username is empty!'));
    }
}
The reason why it's not displayed are:


Since the field is required, Drupal handles that already so your user-defined validation wouldn't run since Drupal make's sure the field passes "required" validation and when it reaches your trapping, it's never empty.

  First ensures required fields are completed, #maxlength is not exceeded, and selected options were in the list of options given to the user. Then calls user-defined validations.


Reference: function _form_validate


Here is an example that your functions are right.

if ($form_state['values']['name'] == 'asdasd'){
    form_set_error('name', t('username is asdasd!'));
}


That will trigger your validation since it passes the "required" validation and checked the username for something aside from being empty which conforms to the description of the _form_validate.