The cancel link on the invite/withdraw confirm form is hard coded to "user/$user->uid/invites/{$origin}". Therefore, users are not correctly redirected if the destination query string is set.

Attached is a patch to reset the cancel link to $_GET['destination'] if the value is set.

CommentFileSizeAuthor
#1 invite_destination.patch2.55 KBhefox
invite.patch1011 byteselliotttf

Comments

hefox’s picture

StatusFileSize
new2.55 KB

I needed this functionality, but I went about it a different way. Having to put something for origin in the url is awkward for those returning to those pages, in my opinion. So instead I suggest using drupal_get_destination for the page links and cancel function. Attached is my patch; line numbers probably off since haven't upgraded since roles were fixed (had my own fix for that).

things that'd have to be changed

1) menu defination of the path to like resend, ie invites/withdraw/reg_code (invites/withdraw/%invite)
2) cancel function takes in $invite and doesn't load it later;
3) drupal_goto, replace any path with $_REQEST['destination']
4) Page links contains drupal_get_destination as a query

I have not been able to test it on the page since I have overridden the pages with a view

YK85’s picture

subscribing

YK85’s picture

Patching went well. Will continue to try to make sure 'all is good' but not 100% sure what to look for.

patching file invite.module
Hunk #2 succeeded at 1234 (offset 54 lines).
Hunk #3 succeeded at 1250 (offset 54 lines).
Hunk #4 succeeded at 1264 (offset 54 lines).
patching file invite_admin.inc
Hunk #1 succeeded at 372 (offset -1 lines).
Hunk #2 succeeded at 382 (offset -1 lines).
YK85’s picture

Status: Needs review » Reviewed & tested by the community
YK85’s picture

Should have mentioned before that I was able to test and the destination issue was resolved.
I see smk-ka on a roll with committing many patches and hope this makes it in as well! =)

smk-ka’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks! Let's keep on rolling :)

YK85’s picture

yey! =)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.