submit handler not working when using hook_form_alter I am using hook_form_alter to add validation and submit handlers to the registration form:

&lt;?php
function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) { 
  if ($form_id == 'user_register_form') {
    $form['#validate'][] = 'blah_register_validate';
    $form['#submit'][] = 'blah_register_submit';
  }
}
?&gt;


They were both working fine until I added the following hook:

&lt;?php
function MYMODULE_user_login(&amp;$edit, $account) { 
  drupal_goto('user');  
}
?&gt;


The validation function still works but the submit function gets bypassed completely - it doesn't get called at all by form_execute_handlers() in form.inc. As soon as I remove hook_user_login, it works again. Anyone have an idea why?

Update:

hook_user_login() gets called by user_login_finalize() in the User Module. Unfortunately,  this happens before my submit function gets called - so obviously when I use drupal_goto() the submit function will never get called. Can anyone confirm if I am adding the submit handler correctly, is there another way?
If you check out drupal_goto() you can see it calls drupal_exit() which is not something you want to do in a hook. The comments for hook_user_login() discuss this a little, finishing with this snippet:

function mymodule_user_login(&amp;$edit, $account)
{
  // Your logic will set $redirection to the desired location
  $redirection = 'node/394';

  // Unless there is already a redirection going, or the user is trying to reset his password, we redirect to $redirection.
  if (empty($_GET['destination'])
    &amp;&amp; !is_null($redirection)
    &amp;&amp; (!isset($_POST['form_id']) || $_POST['form_id'] != 'user_pass_reset'))
  {
    $_GET['destination'] = $redirection; // Should we use $edit['redirect'] instead..?
  }
}


Also mentioned is the login destination module.