I've got several problems going on but this one mirrors this post: http://drupal.org/node/115826. I'm getting the following slew of errors when I hit the retroactive part of the module. Here's one pulled from the log:

Column count doesn't match value count at row 1 query: INSERT INTO userpoints VALUES (46, 0, 1174098663) in /home/getthemb/public_html/includes/database.mysql.inc on line 172.

I can't get the invite module to work with userpoints either -- no one is getting credited for their referrals. I'm hoping that fixing this database error may make the invite module work with it, too.

I'm not techie at all and have no idea how to go about fixing this. Any help would be very welcomed!

Comments

dami’s picture

Yes, it's a bug and is easy to fix. I have submitted an issue here:

http://drupal.org/node/127921

moominmama’s picture

I'm enough of a newbie that I don't understand that post or how to fix it. Can anyone walk me through it?

dami’s picture

I didn't test it but a dirty fix might be just changing line 67:

db_query('INSERT INTO {userpoints} VALUES (%d, 0, 0, %d)', $user->uid, time());

to

db_query('INSERT INTO {userpoints} VALUES (%d, 0, 0, 0, %d)', $user->uid, time());
moominmama’s picture

I'm sorry -- you are being so generous with your time!

Which file do I need to edit?

(And thank you thank you for helping with this!)

dami’s picture

userpoints/contrib/userpoints_retroactive/userpoints_retroactive.module

Again, I didn't test it. So don't be surprised if it doesn't work :)

moominmama’s picture

It worked!

Original line:
db_query('INSERT INTO {userpoints} VALUES (%d, 0, %d)', $user->uid, time());

Changed to:
db_query('INSERT INTO {userpoints} VALUES (%d, 0, %d, 0)', $user->uid, time());

Everything's grand! Thanks!

changlin’s picture

Thanks dami.
Just a small problem, the changed script should be as following:
db_query('INSERT INTO {userpoints} VALUES (%d, 0, 0, %d)', $user->uid, time());
The Table structure is ( uid , points, max_points, last_update)

kbahey’s picture

Title: Errors in retroactive » Incorrect column count error in userpoints retroactive
Status: Active » Fixed

Committed to 5.x.

mjohnq3’s picture

In the version of the Userpoints that I just downloaded, 5.x-2.1, (retroactive module v 1.1.2.4 2007/03/10 14:54:50 kbahey) the fix shown in Item #6 works but the fix shown in Item #7 does not and still produces the error(s).

kbahey’s picture

Version: 5.x-2.1 » 5.x-2.2

Fixed in 2.2

Anonymous’s picture

Status: Fixed » Closed (fixed)