At line 1092 of the invite.module, there is

    // Everything went well: redirect to pending invites page.
    $form_state['redirect'] = "user/$user->uid/invites/pending";

My question is, rather than sending the user to that /user/[uid]/invites/pending page upon successfully sending the invite, might it be possible to send them back to whatever page they were on before they went to the /invite page?

This would make the flow like
1) user goes to page with link to /invite page
2) user clicks link to /invite page
3) user sends an invite
4) user is redirected back to the page they were on before clicking the link

Comments

chousmith’s picture

Status: Active » Closed (fixed)

nevermind, just had to change the link href on my end to /invite?destination=<?php echo drupal_get_path_alias($_GET['q']); ?>

mattcasey’s picture

For others who find this page looking for a way to redirect the invite form:

Drop this in a module to fix the redirect for everyone including admin:

function mymodule_form_invite_form_alter(&$form, &$form_state) {
	$form['#action'] = url('invite', array('query' => 'destination=' . drupal_get_path_alias($_GET['q'])));
}

(In our case, the pending requests are on the same page as the invite form).