In function userpoints_comment() for case 'insert' the parameter uid is defined:
'uid' => $user->uid,
Shouldn't it be instead:
'uid' => $comment['uid'],
I tried it and it works fine.
Does anybody sees a problem with that?

Explanation for using 'uid' => $comment['uid']
It can happen, through whatever, that the logged in user ($user) is not the author of the comment. The author might even be anonymous $user->uid = 0. In that case the logged user would get points for a comment he isn't the owner of.
In function userpoints_nodeapi() for case 'insert' the author is defined 'correct' with: 'uid' => $node->uid.
E.g. I extended the comment form with the possibility to choose whether to post the comment 100% anonymously. The comment is then stored with uid = 0. Unfortunately the logged in user still gets points for a comment he is no longer the owner of.

I'm not sure whether it is a bug or a task... feel free to change.

--
Andreas

Comments

avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -insert, -, -uid

I am closing this issue, since it is for a Drupal version that is no longer supported. Please re-open this issue if it is relevant for a project release for a supported Drupal version.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.