Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi everyone!
I have got hook_form_alter function in my module:
function dashboard_form_user_register_alter(&$form, &$form_state) {
$form['#redirect'] = array('<front>'); // or $form['#redirect'] = '<front>';
}
This code does not working.
As I understood, after form submit, user should be redirected to the site front page, is not it?
Comments
And...
...it does not working like this:
Hi, try <?php
Hi,
try
$form_state['redirect'] = '<front>'
in the hook_submit handler
I had a strange behaviour with it too. the redirection wouldn't work and after setting a drupal_write_record in my code, it worked...
see this thread too : http://drupal.org/node/134000
hope this help you to find a solution ;-)
http://www.sabugo.ch
http://www.titouille.ch
Thank you for answering, but...
Thank you for answering, but this does not working too.
Nope...
Even, it does not work like this:
And the solution is:
This comment helped me: http://drupal.org/node/580144#comment-3368072
Just need to add
before
Good to know the trick. I
Good to know the trick.
I have spent half a day with the same problem... No effective redirection, with $form['#redirect'], $form_state['redirect'], drupal_goto, etc...
And with addition of some line of code to complete my submit function, the redirection will perform, like magic... Ô_o not understand...
http://www.sabugo.ch
http://www.titouille.ch
Thanks for this tip. Had
Thanks for this tip. Had spent WEEKS debugging this issue.
Thanks!
Thanks a Million!