Hi all,

Frist of all, this is a great module!

A small bug I've found in the version 1.4. In the function userpoints_votingapi_votingapi_insert there is a global variable global $user; that is not present in the equivalent function userpoints_votingapi_votingapi_delete. This variable is used to check if the user votes a node that it was created by himself/herself. As it doesn't exist in the delete function, right now, if you change your vote in a node that it was created by you, the system will take from you points that were never given to you (because the insert function is correct), so you will loose points.

The good example to see is to vote a node from you with the same puntuation it had before. After that you should have 0 points, but instead you will have -1 or whatever you set as puntuation.

I added the line global $user; at the beginning of userpoints_votingapi_votingapi_delete and it works.

Cheers

Comments

kmillecam’s picture

Status: Active » Fixed

Thanks for catching this dajoropo.

I've committed your change to the Dev version of the module.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.