Closed (duplicate)
Project:
User Points
Version:
6.x-1.x-dev
Component:
Code: userpoints API
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2009 at 16:19 UTC
Updated:
11 Jul 2010 at 17:47 UTC
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.
| Comment | File | Size | Author |
|---|---|---|---|
| userpointscachetaxonomy.patch | 621 bytes | tom_o_t |
Comments
Comment #1
BillyMG commentedI 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.
Comment #2
mile23This looks like a duplicate and also looks fixed. http://drupal.org/node/690796