Closed (works as designed)
Project:
Drupal core
Version:
6.3
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2008 at 03:46 UTC
Updated:
29 Jul 2011 at 14:44 UTC
Guys,
I created a form and set $form['#redirect'] = ''; but later on _submit(), i changed the $form_state['redirect'] to another value, with no effect. If matter, is was an array with two values: the url and GET values. According to documentation, it should be enough to set the $form_state['redirect'] to make it work.
it seems that drupal_redirect_form() prefers the value from $form['#redirect'] instead from $form_state['redirect'], which goes as the second argument.
regards,
massa
Comments
Comment #1
dropcube commentedA redirection only occurs if the
$form_state['storage']bundle, and the$form_state['rebuild']flag has not been set.$form['#redirect']is used if$form_state['redirect']is not set.Comment #2
aurels commented>> A redirection only occurs if the $form_state['storage'] bundle, and the $form_state['rebuild'] flag has not been set.
What do you mean by "if the $form_state['storage'] bundle"?
Is this kind of code supposed to work on Drupal 6?
Thanks.
Comment #3
aurels commentedIt wasn't a problem, I just had forgotten to pass the second argument by reference!
Comment #4
kaine commentedhi guys,
I have a different problem, I want to redirect my form to a page by setting the $form['#redirect'],
but where does it have to be settled?