On line 743 of userpoints.module in function _userpoints_update_cache(&$params) there is the following code:

  if (!isset($params['tid'])) {
    $params['tid'] = NULL;
  }

I'm pretty sure that the NULL is incorrect, it should be 0 - this is the value that is saved in the userpoints table for uncategorized points.

If NULL is used the users' points never get updated in their profile or in the userpoints block when uncategorized points are awarded or deducted - they are only added to the userpoints_txn table.

Attached is a patch to fix this. I would appreciate testing to see if this causes problems in different site configurations.

CommentFileSizeAuthor
userpointscachetaxonomy.patch621 bytestom_o_t

Comments

BillyMG’s picture

I noticed this same issue when working with several other features to add points, and it seems that your fix work. I'm using the 5.x-3,x version (different line, same idea) and it's the same issue. If the TID is null, then it tries to do an update (it sees if the user is in the cache via the _userpoints_user_exists() function, which returns true if the TID is null and if the user has any kind of points in the table) instead of an insert and the user never really gets the points. I haven't seen any negative impact to changing this yet, so hopefully this small fix will allow for it to work without any issue.

mile23’s picture

Status: Needs review » Closed (duplicate)

This looks like a duplicate and also looks fixed. http://drupal.org/node/690796