Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I will do this myself if I get a chance, but thought I should create an issue for it. The 4.x branch of Invite is much better than the original 2.x branch that user_relationship_invites is built around, and includes rules and views support.
Comment | File | Size | Author |
---|---|---|---|
#21 | user_relationships-2041769-21.patch | 4.56 KB | mrded |
#21 | interdiff-2041769-18-21.txt | 3.69 KB | mrded |
Comments
Comment #1
chrism2671 CreditAttribution: chrism2671 commentedI've written a patch now that supports both versions. I will post it as soon as I've had a chance to test it thoroughly.
Comment #2
Martin Mayer CreditAttribution: Martin Mayer commentedCan I help you testing the patch?
Comment #3
chrism2671 CreditAttribution: chrism2671 commentedYes! Here you go!
Comment #4
chrism2671 CreditAttribution: chrism2671 commentedComment #6
mrded CreditAttribution: mrded commentedComment #7
mrded CreditAttribution: mrded commented#3: user_relationships-make-it-work-with-invite-4.x-2041769-3.patch queued for re-testing.
Comment #8
chrism2671 CreditAttribution: chrism2671 commentedAs requested by someone, here is the full module code, for anyone struggling to apply the patch. If the patch doesn't apply cleanly, please report it in this thread.
Comment #9
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedOne thing didn't work quite right. If I sent a UR Invite to someone who already has an account on the site, they rightfully get the invite notice, but when accepted, the relationship is not established.
Comment #10
chrism2671 CreditAttribution: chrism2671 commentedIt should work, and did work in my testing. This part of the logic hasn't changed so afaik it should be ok. Do you know specifically what caused the issue you're seeing?
Comment #11
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedI looked through the code, but couldn't see where the relationship is being assigned. The invite is sent, of course, but no relationship.
Comment #12
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedSo, it looks like what's going on here is this:
User already has an account, so user logs in. Clicks "accept" in the message area. Menu item 'invite/accept/%invite_by_code' is called, and function invite_accept() is fired.
As I step through that function, there is nothing that goes back to user_relationships_invite module, so nothing happens to the relationship request.
I think the best option here is to use hook_entity_update() on the 'invite' entity and fire off the relationship acceptance in that function.
Thoughts?
Comment #13
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedThis works for me, but I don't think I've tested it on all possibilities.
Comment #14
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedThis is probably a better way: hook_invite_accept()
Comment #15
chrism2671 CreditAttribution: chrism2671 commentedOK I haven't checked it since you posted this; but then again my patch didn't change this section of code. (I will check it when I get time).
As I recall though, there is a checkbox that is added on the user reg form that says something like 'accept invitation', so the actual process of accepting it goes through the browser (rather than through the backend).
Comment #16
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedThe invite for NEW users works fine. What I'm talking about is sending an invite to an EXISTING email address.
It also doesn't really create the user_relationships request, so it doesn't show up in any of the views.
Lastly, and I think this is a bug in the Invite module, the link to reject the invite is broken, if you're an existing user who has been sent an invite.
I'll look to filing an issue about that and post it here when I find it.
Comment #17
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedHere's some code for user_relationship_invites_invite_form_validate() that creates ur requests
I'll wrap this all up in a patch momentarily.
Comment #18
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedHere's the updated patch including #14 and #17
Comment #19
chrism2671 CreditAttribution: chrism2671 commentedAh, I hadn't tested this case, I was under the impression that the invite module's sole purpose was to invite new users to the website. Exactly how are you using it then? How does this differ from the request relationship email that's in user_relationships?
Comment #20
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedIt's not really any different, because, really, how would the inviter user know? Currently, Invite doesn't do anything to tell you that the user is already a member of the site. But in either case, they'll want a UR relationship, so it should oblige.
In my case, I'm likely to use both. I'll have a "find friends" screen to use the UR request email, and a "Send an Invite" screen, which the user will think is a new user. But if it's not a new user, it still needs to work similar to a UR request.
Edit: for clarity.
Comment #21
mrded CreditAttribution: mrded commentedRefactor code and change to Drupal code standards.
Comment #22
madhudvs CreditAttribution: madhudvs commented21: user_relationships-2041769-21.patch queued for re-testing.
Comment #23
madhudvs CreditAttribution: madhudvs commentedhi guys.... it would be nice if new invite module works with UR
i tried both patchs #18 and #21 with no result...
if "Request relationship" is selected in invite block... the site breaks..
any updates in this regard ?
Comment #24
madhudvs CreditAttribution: madhudvs commentedComment #25
mrded CreditAttribution: mrded commented@madhudvs, why did you close the issue? It hasn't been done!
Comment #26
mrded CreditAttribution: mrded commentedGuys what if we'll move the module to separate project? In this case we can create separate branch for different versions of Invite module.
I've already started to do that in my sandbox Invite User Relationships
Comment #27
mrded CreditAttribution: mrded commentedI've released Invite User Relationships module which will integrates User Relationships with Invite 7.x-4.x module.
Please take a look.