In user_stats.rules.inc - the type for the uid, is listed as 'number' by default. This will fail rules validation since there is no 'number' type resulting in a catastrophic fail for running rules based on user stats.

Switch to 'integer' and all is well.

Comments

Bastlynn’s picture

Well, mostly fine.

In addition, the value for uid isn't passed in in quite the format expected. This needs to be changed as well:

function user_stats_events_argument_user($uid, $value) {
return user_load($uid['uid']);
}

Without this change, the entity load will throw a fit about not having $ids as a string or integer, since an array is getting passed in otherwise.

FWIW this is against Rules version 7.x-2.3

mermemladeK’s picture

Hey Bastlynn,

I cannot so far execute rules when post count is increased, decreased or reset. I am trying your fix but no success so far.
One thing I never manage to solve either and I never got an answer from the mantainers of this module, was how to retrieve the post count number from a user.

Along your reasoning I was thinking maybe I should apply also change 'number' to 'integer' in here:

    'statistic_value' => array(
      'type' => 'integer',
      'label' => t('Value of the statistic'),
    ),

I tried this but so far it's not working.
What do you think?

PS: I think I'm just gonna add some post_count fields and remove User Stats because so far this module has been more of a pain than anything else!