Hi I am using userpoint 5.x-2.14 with drupal 5.1.
I have a very weird problem. For certain users, if they create a new node, then they get points. (30 point as I defined)
But if they modifies the content, then the original poster loses point and someone else gets 5 points. This 5 points is the point for adding comment.
* User xsaku earned 5 points! Total now is 570 points.
* User dragonkun lost 5 points! Total now is 1936 points.
Did anyone have the same problem?
I upgraded drupal 4.7 to 5.1 and 4.7 did not have this problem.
This problem started to happen after I upgraded to 5.x but I do not exactly remember which userpoints version started to trigger this problem.
Comments
Comment #1
kmillecam commentedI'm experiencing a similar issue.
Upgraded to Drupal v5.1 over the weekend and now when I approve moderated comments, the poster loses his/her 5 points and I am awarded 5 points.
Kevin
Comment #2
kbahey commentedSetting this to critical.
Comment #3
mracarpenter commentedI have a wiki Drupal site and any time another user edits a wiki page that a different user created it will take the 30 points away from the creator and transfer it to the editor. I do not seem to have a problem with the comments though.
Comment #4
kmillecam commentedI was able to duplicate the behavior I was seeing (with comments) on a fresh install.
It appears to be related to the "preview" step in the approval/moderation process.
If I go to the list of comments pending approval and tick the checkbox next to them and approve the entire list, userpoints works as advertised.
But, if I open a comment on that list and approve it using the radio button under the "administer" heading, two entries are entered in the userpoints_txn table ... one that deducts the user's points and another that gives (what appears to be a random user) 5 points. Sometimes that user is me, sometimes it's another user, sometimes it's an anonymous user.
Comment #5
protoplasm commentedwe are having problems with points being subtracted when someone edits a comment.
Comment #6
fhelmschrott commentedi second this and add the information that a random/changing user seems to get the points. today it is a user that doesn't even exist in the users database anymore (he got deleted).
Any help would be appreciated.
Comment #7
kmillecam commentedI changed the userpoints_comment() function in the userpoints.basic module to something that appears to have solved the problem.
It appears that the author was trying to reassign points in cases where the author of a comment was changed by the administrator. I probably have not interpreted the author's intent (please clarify if you have time) but I didn't see a case where a comment's author would be changed so I removed this code and things appear to be working as advertised.
I changed these lines (starting at approximiately line 110) ...
From this (before edits):
To this (after edits):
Comment #8
yngens commentedI also have this problem. Could the module's maintainer confirm that it is ok to apply code change in #7, please. I do not want to break some other functionalities.
Comment #9
kbahey commentedkmillecam
Can you submit this as a patch to the latest 5.x?
Comment #10
kmillecam commentedHere's a patch against userpoints-5.x-2.14 that includes the changes listed above.
Kevin
Comment #11
kbahey commentedI applied kmillecam's patch above.
However, this addresses only comments. Not sure if it will address other issues that are reported in this thread.
To everyone in this issue: please way for 12 hours from the time of this comment, then download the 5.x-dev tarball and see if it solves your problem. Report back what you find. If it solves them, then I will create a 5.x-2.15 official release.
Comment #12
ksoonson commentedit solved the original issue.
I am also curious other people's result.
Comment #13
yngens commentedi confirm suggested changes fixed the problem.
Comment #14
palik commentedi got 5.2 drupal with last stable userpoints and got this bug fixed by this patch
thank you! :)
Comment #15
jredding commentedappears to be squashed.