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.
The hook_invite provides basic operations for the invite lifecycle (invite, escalate, cancel), but the 'escalate' does no contain the code that was used for the invite. This may be valuable to another module as it can track unique invites and map them for use in lookup.
This should be relatively easy as the $invite variable contains the code to be passed back in the hook in most situations -- see patch.
Comment | File | Size | Author |
---|---|---|---|
#6 | 622776-invite-context_1.patch | 1.39 KB | hefox |
#4 | 622776-invite-context.patch | 1.37 KB | smk-ka |
escalate_hook_invite_add_code.patch | 654 bytes | christianchristensen |
Comments
Comment #1
Gekiboy CreditAttribution: Gekiboy commented+1 on the feature request, haven't tried the patch
Comment #2
Gekiboy CreditAttribution: Gekiboy commentedAs an added note, because the user who is invited can potentially register with a different email address than the one which was used for sending the invite, there is no definite way to attach any functionality to a particular invite without the registration code. Adding it in is a simple matter of passing $invite->reg_code into the _invite_escalate_role() function and then passing it into the module_invoke_all() call. If would be really useful to be able to have this functionality without having to result to a patch.
Comment #3
YK85 CreditAttribution: YK85 commentedwould this in any way help #622152: Rules Integration
Comment #4
smk-ka CreditAttribution: smk-ka commentedHere's a patch that passes the invite code as additional parameter. This makes hook_invite('escalate') behave consistently with the other hook op's.
Comment #5
YK85 CreditAttribution: YK85 commentedAwesome! I have someone looking into the Rules Integration and hope he will be able to post a patch in the near future.
Comment #6
hefox CreditAttribution: hefox commentedHow about instead giving it the entire invite object instead? I needed to do this wonkyness to get the entire invite. (I needed to allow site admins pick a role on inviting, so stored it in $invite->data u.u)
This is really desired as invite_load isn't cached, and neither is user_load, which it calls.
Comment #7
YK85 CreditAttribution: YK85 commentedI'm not sure how to test but hope this may be reviewed by someone to help with Rules Integration.
Thank you very much
Comment #8
apadernoI am closing this issue, since it's for a Drupal version no longer supported.