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,
The submit callback of the withdraw confirm form does a drupal_goto() and that, among other side effects, it is not possible to alter the redirection from custom modules.
File affected is includes/invite.pages.inc
Function invite_withdraw_form_submit()
The fix is pretty trival:
- drupal_goto('<front>');
+ $form_state['redirect'] = '<front>';
Cheers
Comment | File | Size | Author |
---|---|---|---|
#5 | invite-2227995-avoid_drupal_goto-5.patch | 486 bytes | kaare |
#4 | invite-use_formapi_for_redirect-2227995-4.patch | 504 bytes | moertle |
#3 | invite-use_formapi_for_redirect-2227995-3.patch | 649 bytes | moertle |
Comments
Comment #1
robmc CreditAttribution: robmc commentedI second this change!
Cheers,
Rob
Comment #2
lhridley CreditAttribution: lhridley commentedPlease submit a patch for this.
Comment #3
moertle CreditAttribution: moertle commentedThere you go
Comment #4
moertle CreditAttribution: moertle commentedSorry, wrong patch, another try
Comment #5
kaarePatch works as recommended, and without this patch it's impossible to add our custom redirect destination as described in Redirecting a Form.
I've tested this patch with and without custom redirection and the
invite_withdraw_form()
now behaves as expected.I've recreated this patch better suitable for project maintainers to apply quickly (i.e. without the
sites/all/...
path.Comment #6
ckngThanks for the code, committed.