<p>Hi</p>
<p>First, I realize what I'm doing isn't the most usable, but it's how the client wants it.</p>
<p>On the homepage, the user login block is styled all fancy and
compact. Unfortunately, it's compactness prevents a place for an error
message if the user messes up their username or password.</p>
<p>So, what I'd like to do, when the form fails validation, is redirect the user to "/user" which displays the regular login form along
with the error messages that would of displayed within the block.</p>I tried the following (in my own module),<br><br><code>function myutility_form_alter($form_id, &$form) {<br> switch ($form_id) { <br> case 'user_login_block':
<br> $form['#validate'] = array('utility_user_login_validate' => array($form_id, $form)); <br> unset($form['links']); <br> break;<br> }<br>}<br><br>function myutility_user_login_validate($form_id, $form_values) {
<br> user_login_validate($form_id, $form_values); <br> if (count(form_get_errors()) > 0) { <br> drupal_set_message('test error message'); <br> //print "here";<br> drupal_goto('user');
<br> }<br>}<br><br></code>The drupal_goto doesn't seem to work here. I'm fairly confident the code is making it to the drupal_goto because if I uncomment the "print" statement is does get called and prints out "here".
<br><br>Any ideas why drupal_goto isn't working in this case?<br><br>Thanks for the help.<br>