1

When creating a new node doing a $form['redirect'] seems to work consistently, but doing the same redirect when editing an existing node doesn't. The problem only occurs when the admin overlay is shown.

Is there any way around this?

0

This does the trick ;)

The code below was added in hook_form_alter().

/* Set the desired redirect */
$form_state['redirect'] = 'node/add/lesson';

/* Then clear the "destination" value */
unset($_GET['destination']);
drupal_static_reset('drupal_get_destination');
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.