Just noticed that the block "User's points" doesn't show a sum of the user's points. Rather, it finds the first match from the userpoints table and uses that value. I believe this a code artifact from before we had taxonomy.

So, on line 1477 which reads:
$points = (int) db_result(db_query('SELECT points FROM {userpoints} WHERE uid = %d', $user->uid));
we'd be better off with something like this:
$points = userpoints_get_current_points($account->uid, variable_get(USERPOINTS_CATEGORY_PROFILE_DISPLAY_TID, 0));
which would use the setting from the admin page OR
$points = userpoints_get_current_points($account->uid, 'all');
to simply display a total sum, no matter the category.

CommentFileSizeAuthor
#2 userpoints.module.patch876 bytesfred0
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fred0’s picture

Would love to see this get into the next build so I don't have to keep tweaking the file every time I update.

fred0’s picture

Priority: Normal » Critical
FileSize
876 bytes

Khalid,

Any chance we can get this into the next update?
Here it is as a patch.

Thanks!

kbahey’s picture

Status: Active » Fixed

I hope this works just the same when no categories are used, like most people do.

Committed.

fred0’s picture

Thanks!

It's the same call as is used in the userpoints_user function to display points on the profile page so, should work the same way.
However, now that you mention it, it might make sense to add a new variable entry and form setting in the block so that the points category could be set independently of the profile page display setting. I'll try to knock that out this week and upload a new patch.

Status: Fixed » Closed (fixed)

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