Closed (fixed)
Project:
User Points
Version:
5.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Feb 2008 at 16:10 UTC
Updated:
18 Mar 2008 at 09:51 UTC
Userpoints is not displaying the totals for "Approved Points Balance:", "Points awaiting moderation:", and "Net Wit Points Balance:" at the /myuserpoints screen. Please see attached screen shot.
I am using Drupal 5.5 with PostgreSQL.
| Comment | File | Size | Author |
|---|---|---|---|
| Userpoints.PNG | 45.45 KB | WISEOZ |
Comments
Comment #1
jredding commentedMy guess is an incompatibility with Postgres SQL.
Do you have any errors in your log? Specifically DB errors.
Comment #2
kmillecam commentedNot working for me either ... using MySQL.
Comment #3
jredding commentedwasn't this fixed? I remember there was an issue with this in one of the early, releases of version 3 but I know it ws fixed before official release. Somewhere in the issues this has already been reported and fixed.
Is this actually using DEV and not the Stable verison?
Please clarify on the use of Dev vs. Stable and if you're using Dev try using the stable version to see if you still have this error.
Comment #4
kmillecam commentedSorry, false alarm on my part.
I'm running 5.3.3 and the totals on /userpoints are working as advertised.
Comment #5
WISEOZ commentedWell, it somehow fixed itself. Weird! I am using 5.x-3.x-dev, nothing changed, yet totals display correctly.
Comment #6
jredding commentedJust a quick followup. Note that this project uses dev/stable releases correctly thus by using Dev, as a non developer, you are pretty much asking for bugs. You are not gaining any additional features by living in Dev.
I fully understand other modules are not handled in this way but this one is.
Comment #7
cookr1965 commentedI'm having this exact same problem. Running Drupal 5.7 w/ userpoints 5.3.3 stable release. Totals work fine when using the uncategorized category, but once I create my own terms in the userpoints vocabulary and pass points to them, the totals break on the "my userpoints page". All of the points transactions in the table are working fine, but no totals. I have no errors in my logs at all. The code in userpoints.module seems fine, can't find anything obvious. Checked permissions on all files involved as a last ditch effort but to no avail, still not working. Running php 5.2.5, mySQL 5.0.41, apache 2.x, on OSX 10.4.11 Tiger.
Any help would be greatly appreciated. Thanx in advance.
Comment #8
cookr1965 commentedI have run through the code in userpoints.module and found a problem. For some reason, at least in my case, the if statement on line 1507 is not returning TRUE, so the module fails to look up the user's total.
if (_userpoints_user_exists($uid)) {
}
I will continue to probe the issue and see if I can't figure it out.
Will post my findings.
Comment #9
cookr1965 commentedThe problem is definately in the _userpoints_user_exists() function on line 758.
function _userpoints_user_exists($uid, $tid = NULL) {
return (int)db_result(
db_query('SELECT COUNT(uid)
FROM {userpoints}
WHERE uid = %d AND tid = %d ',
$uid, $tid));
}
On line 1507, $uid is passed to the function, but $tid is not. When $tid is not passed, the function defaults $tid to NULL, which returns an empty result set from the {userpoints} table because all the tids in the table have a value. It looks like the _userpoints_user_exists() function was written for updating the caching table on line 715, so I don't want to mess with it. Removing the call to it on line 1507 works for my purposes...though proper validation would be nicer.
I hope this is of some help to others with the same problem.
ciao.
Comment #10
jredding commentedto reproduce
Install userpoints
Add a term into the userpoints category
Modify the default point total to the new category (anything other than default)
Add points
If there are no points in the uncategorized category no point totals will be displayed
Comment #11
jredding commentedProblem found and fixed. Checked into CVS
Comment #12
cookr1965 commentedSorry for the duplicate bug report....new to drupal.
Didn't mean to make your life difficult.
I'll get it right next time.
ciao.
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.