I'm using Drupal 6.10.
User karma doesn't update "On nodes" or "On comments". All the other plugins work.
The bugs are in user_karma_receive_vote_node.module line 139 and user_karma_receive_vote_comment.module line 141:

        $karma = db_result(
            db_query(
              $query, 
/*139*/              array_merge(array($uid), $content_types_array, $value_types_array)
            )
          ) * variable_get('user_karma_receive_vote_node_karma_multiplier', 1) ;

This would perform the following _db_query:
SELECT SUM(vv.value) FROM votingapi_vote vv LEFT JOIN node n ON vv.content_id = n.nid WHERE vv.content_type in ('4') AND vv.value_type in ('node') AND n.uid = 0 AND n.created > (1239649267 - 7776000)

which is incorrect, it always returns 0 and there's your karma.

The $query's variable order is content_type, value_type and uid, therefore we should send them in the same order

array_merge($content_types_array, $value_types_array,array($uid))

This change will run the following query in the database:
SELECT SUM(vv.value) FROM votingapi_vote vv LEFT JOIN node n ON vv.content_id = n.nid WHERE vv.content_type in ('node') AND vv.value_type in ('points') AND n.uid = 4 AND n.created > (1239649813 - 7776000)

Now we're talking!

Lost a few hours on this one. Anyway... see it in action on my website RageThread.com.
Have a nice day.

Comments

niteman’s picture

5.x branch is also affected by this

mercmobily’s picture

Status: Active » Fixed

Hi,

This is fixed in the developers version of the module... and it was fixed at the time you reported the bug.
Sorry about this. And thank you!!!

I will get a stable out very soon...

Bye,

Merc.

P.S.
Are you able to lend a hand completing this module?

Status: Fixed » Closed (fixed)

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

bflora’s picture

Will this be brought over to the main download anytime soon? You shouldn't have to read the issue queue for a module to learn that 2/3 of its functionality doesn't work at all out of the box.

bflora’s picture

Was this fixed in the D5 dev version of the module?

I switched over to the D5 dev version and the clout for nodes appeared to be working. But 5 days later it stopped completely. Any idea why that may have been?

Found problem. Was an apache issue.