In one of my forms, I'm trying to set a $form_state['redirect']
so the form will go to that destination after the user clicks one of the action buttons.
If I inspect $form_state['redirect']
both before and after I add the redirect, it is NULL before, and after contains the proper array. Here's how I'm setting up the redirect:
$form_state['redirect'] = array(
'my/custom/path/' . $nid,
array('query' => drupal_get_destination()),
);
I want to preserve the destination from the form that the user's viewing to the next path (that's why I'm calling drupal_get_destination()
, which returns an array with 'destination' => 'some/path/here'
inside.
It seems that, because there's already a destination in the path of the current form, the form redirects to that destination no matter what I put in my own form submit handler (see above code). I even tried using drupal_goto() and that didn't redirect the user either.