The current version of userpoints has some issues in working with invite module.
Points of a user are updated when someone creates a content etc. But, points are not updated when a user invites someone. The points for invite_invite & invite_register are assigned.

CommentFileSizeAuthor
#6 invite-userpoints.patch1802 bytesericwagner

Comments

kbahey’s picture

Project: User Points » Invite
Priority: Critical » Normal

The 4.6 version of invite worked fine with userpoints.

The 4.7 version of invite was modified some time back in a way that it no longer works with userpoints.

Therefore, I am moving this issue to invite.module.

mediafrenzy’s picture

Hi, just wondered if anyone has a patch on the way for this issue?

I can't help with coding, but I will happily test possible solutions on my 4.7.3 test site, as we're really wanting this module to tie in with the userpoints module.

Thanks

prateek’s picture

I am also eagerly waiting the fix.

mediafrenzy’s picture

Has anyone got these two modules working together correctly? If anyone could help us on this, it would be greatly appreciated.

kbahey’s picture

See my comment above (#1).

Invite needs work in order to function again with userpoints.

ericwagner’s picture

StatusFileSize
new802 bytes

Actually, Invite changed what it does with module_invoke_all. The operation "regsiter" has been changed to "escalation" and it sends different arguments. This patch fixes userpoints to work with Invite:

--- userpoints.module.orig      2006-10-21 12:39:40.000000000 -0700
+++ userpoints.module   2006-10-21 14:29:09.000000000 -0700
@@ -394,16 +394,16 @@ function userpoints_nodevote($nid) {
   _userpoints_update_points($points, $user->uid, 'nodevote');
 }

-function userpoints_invite($uid, $op) {
+function userpoints_invite($op, $args) {
   switch($op) {
     case 'invite':
       $points = variable_get(USERPOINTS_INVITE_INVITE, '1');
       break;
-    case 'register':
+    case 'escalate':
       $points = variable_get(USERPOINTS_INVITE_REGISTER, '1');
       break;
   }
-  _userpoints_update_points($points, $uid, $op);
+  _userpoints_update_points($points, $args['inviter']->uid, $op);
 }

 function userpoints_karma_rate($rater_add_points, $rated_add_points, $rated_uid) {

Note that the invite case still doesn't work as userpoints doesn't seem to be invoking it.

ericwagner’s picture

Note should read:

Note that the invite case still doesn't work as invite doesn't seem to be invoking it.

kbahey’s picture

Project: Invite » User Points
Status: Active » Fixed

The patch fails to apply.

However, I put in the fixes in it since they are not many.

Applied to 4.7 and HEAD.

Can someone confirm that this works for them?

kbahey’s picture

Status: Fixed » Active

Keeping this issue as active since the invite case does not work.

jredding’s picture

Component: Code » Code: userpoints_invite
Status: Active » Closed (fixed)

invite is working in version 5.x

jredding’s picture

Project: User Points » User Points Contributed modules
Version: 4.7.x-1.x-dev » 5.x-2.x-dev