Download & Extend

hook_invite needs to return 'code' on 'escalate' $op operation

Project:Invite
Version:master
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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.

AttachmentSize
escalate_hook_invite_add_code.patch654 bytes

Comments

#1

+1 on the feature request, haven't tried the patch

#2

As 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.

#3

would this in any way help #622152: Rules Integration

#4

Here's a patch that passes the invite code as additional parameter. This makes hook_invite('escalate') behave consistently with the other hook op's.

AttachmentSize
622776-invite-context.patch 1.37 KB

#5

Awesome! I have someone looking into the Rules Integration and hope he will be able to post a patch in the near future.

#6

How 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)

<?php
$code
= db_result(db_query("SELECT reg_code FROM {invite} WHERE invitee = %d", $args['invitee']->uid));
     
$invite = invite_load($code);
?>

This is really desired as invite_load isn't cached, and neither is user_load, which it calls.

AttachmentSize
622776-invite-context_1.patch 1.39 KB

#7

I'm not sure how to test but hope this may be reviewed by someone to help with Rules Integration.

Thank you very much

nobody click here