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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gekiboy’s picture

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

Gekiboy’s picture

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.

YK85’s picture

would this in any way help #622152: Rules Integration

smk-ka’s picture

FileSize
1.37 KB

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.

YK85’s picture

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

hefox’s picture

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)

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

YK85’s picture

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

Thank you very much

apaderno’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.