Haven't managed to create a rule that works. Have tried a variety of possibilities with rules applied to "after a new referral is recorded". No conditions applied.

Changing order of rule actions and saving brings up the following error:

Warning: call_user_func(administer referrals) [function.call-user-func]: First argument is expected to be a valid callback in RulesReactionRule->access() (line 384 of /sites/all/modules/rules/includes/rules.plugins.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jazzdrive3’s picture

Status: Active » Closed (fixed)

You'll need to use the rules actions provided by UserPoints. Make sure the Userpoints rules integration is enabled.

I fixed the bug and uploaded it to dev.

Will probably roll a new release in the next week or so.

elkole’s picture

Hi,

I don't have this warning message, but I can't create rules for the user point system. The points don't get assigned to the user refferring.
Could you provide a step-by-step instruction how to configure the rules?

thanks

slater101’s picture

This is what I need, No matter what i do it just isn't working.. hope to see this as a plug and play automatic feature some day

IWasBornToWin’s picture

I need help with this also but from the looks of it, we're 3 months since the last response. I wonder if Drupal could start giving user points to people who respond (with solutions) to dead posts? Someone could get rich...

IWasBornToWin’s picture

Status: Closed (fixed) » Active
IWasBornToWin’s picture

My error logs keeps showing the following;

Administration > Reports >
Type referral
Date Tuesday, October 4, 2011 - 23:59
User Anonymous (not verified)
Location http://growtogive.com/?q=user/register
Referrer http://growtogive.com/?q=user/register
Message INSERT of referral data failed.
Severity error
Hostname 108.9.22.116
Operations

It doesnt appear to be verifying who the user is?

IWasBornToWin’s picture

Yet the referrer's account page shows the link to all the users he referred, and they're all unflagged

IWasBornToWin’s picture

any help?

IWasBornToWin’s picture

Priority: Normal » Major
jazzdrive3’s picture

Priority: Major » Normal

Setting it to major isn't going to help, as this particular issue is a periphery to the core functionality. If you need to open up another issue, please do so.

As for this one, I haven't been able to replicate any problems. More info is needed.

IWasBornToWin’s picture

I provided info in post #6 and #7. Can you please tell me the info you need? Every time a referred user signs up, my log message shows the following warning;

referral 10/29/2011 - 23:59 INSERT of referral data failed. Anonymous (not verified)

I will give you more information you tell me what more I can provide you.

I cant even get rules to display a message when a new referral is registered. I cant get it to do anything because apparently (based on log messages) rules isn't aware the new referral is signing up.

Thanks

jazzdrive3’s picture

Are you not getting a line number on the error? Nothing comes up in the message area? You only see this in reports? What version of Rules are you using? Are you using Beta2 of Referral? What is the exact rule you are trying to create?

The values are obviously getting recorded in the database properly, or else you would not see the list of referred users.

IWasBornToWin’s picture

Sorry, no line error

No message when new user registers regarding referral stuff...just typical new user message.

Yes, I only see the message in log reports

I'm using rules 7.x-2.0 but I can uninstall rules and still get the error message in logs reports showing INSERT data failed, so I'm not certain rules will ever be notified of anything differently in order to fire.

I'm trying to create any rule at this point...I've created other rules, but for whatever reason, I cant get this to fire. Initially I wanted to reward user points for referral but when I noticed it wouldn't work I started with a process of elimination and discover no rule is firing.

Yes, I'm using beta2

Would the fact I am using the same IP address to register these new test users have anything to do with this? I've cleared cache and cookies in the browser but that made no difference.

Also, is the log report supposed to show Anonymous user? instead of the username?

Thanks

essbee’s picture

Yep getting this same behaviour. Also preventing me from assigning points from a referral.
Latest versions of all relevant modules.

elkole’s picture

Hi,

I'm happy that the subject is alive again.

Still I wasn't able to configure the rules correctly. So, still I'd appreciate for a step-by-step-instruction or an example.

Besides that, I noticed that, if a user fills in the registering form and clicks "register", the following notice appears:

Notice: Trying to get property of non-object w rules_condition_referral_is_flagged() (line 95 z /httpdocs/sites/all/modules/referral/referral.rules.inc).

I'm using version beta2.

thanks a lot in advance

cheers

IWasBornToWin’s picture

@jazzdrive, just as setting this to "major", according to you, isn't going to help--neither is ignoring it. Is there anything else you would like for any of the several people, on this page who are having a problem with your module, to do for you so we can help you help us?

You module is not telling rules when a new referral is registered. Is there anything we can do to let you know why?

Thanks

IWasBornToWin’s picture

Priority: Normal » Major

Any suggestions?

IWasBornToWin’s picture

Priority: Major » Critical

I think I should change my username to IWasBornToWait :)

I am willing to pay, to give you access to my site, or other ways you suggest I solve this? But at this point, based on the issues que, there doesn't seem to be ANY support for this module? Is this correct?

IWasBornToWin’s picture

Component: Documentation » Code: referral
IWasBornToWin’s picture

It appears the rule is trying to implement the action part prior to the event. Every time I look at the logs it shows the action log PRIOR to the event, and I continually get an error that the user wasnt verified. see below;

user 11/28/2011 - 14:43 New user: referedbyjames33 (referedbyjames33... Anonymous (not verified) edit
referral 11/28/2011 - 14:43 INSERT of referral data failed. Anonymous (not verified)

IWasBornToWin’s picture

Here's another message

Message The reaction rule referral reward (rules_referral_reward) fails the integrity check and cannot be executed. Error: Data selector referring-user for parameter user is invalid.
Severity error

jazzdrive3’s picture

Priority: Critical » Normal

I finally have some time to work on this.

Again, this is not a critical issue. Please stop changing the priority.

All the basics are working, as I have confirmed again. Database is being updated.

That watchdog error you are seeing is just leftover code from the Drupal 6 version and turns out it is irrelevant. The code was checking an object that, in the new Drupal 7 database api, is now undefined. So it was throwing the error no matter what. If you check your database, everything inserted fine. New error reporting has been implemented now that will actually be accurate.

I'm looking into the rules stuff right now.

jazzdrive3’s picture

Just created a rule and successfully assigned userpoints to the referring user. So again, I can't replicate some of these errors.

Attached are screenshots of what my rule looks like.

And here is an export:

{ "rules_after_referral" : {
    "LABEL" : "after referral",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "userpoints_rules", "referral" ],
    "ON" : [ "referral_recorded" ],
    "DO" : [
      { "userpoints_action_grant_points" : {
          "user" : [ "referring-user" ],
          "points" : "10",
          "tid" : "0",
          "entity" : [ "" ],
          "operation" : "Insert",
          "display" : 1,
          "moderate" : "approved"
        }
      }
    ]
  }
}
IWasBornToWin’s picture

Excellent....works well!

dRaz’s picture

Hi,

First of all, I had no issues setting up a points rule with this module.

However, I would like to only give the points once the new user becomes a paid member.

When a user registers on the site they become "Base Member" and are requested to subscribe before they become a "member".

I tried setting up a condition to make this work but to no avail.

Can anyone help with a correct condition/php eval for this?

Sorry if this is slightly off-topic.

Shaun

IWasBornToWin’s picture

You can create a field (in drupal 7) for users, maybe named; status or member status. That field can be changed dynamilly in rules when that member upgrades. You can also run other rules, conditions, etc. based on the field value. It makes things a lot easier than creating a bunch of different roles when the roles would be the same other than one or two things.

This field can be invisible to everyone except you, or just visible to the user but not public.

hockey2112’s picture

Issue summary: View changes

The rule in #23 worked great for me. How can I modify that rule so that it only grants the referral userpoints if the referred user completes a transaction in Ubercart?

Additionally, how can I make it so that the referring user is granted a "per dollar" amount of user points (for example, 10 userpoints if the referred user spends $100)?

Thanks!

marveangel’s picture

hi.....my problem is quite simple I want to award points to referring users after their referrals role changes..say from authenticated user to partner. but no matter how I try I just can't seem to get it....I would really appreciate a step by step guide on how to make this work....FYI I am not a programmer and I am pretty new to drupal