Attempt to write a rule as follows:

Event: "A user relationship has been removed"
Action: "Remove user role"

-> In the Data selector field, [requester] and [requestee] are not available as selections.

I was attempting to write a rule to send private messages to my users (with the privatemsg module) when a relationship was removed when I encountered this bug. I'm assuming this is a bug because in hook_rules_event_info() for the event both requester and requestee appear. Unfortunately, I'm relatively new to PHP and unable to fix this myself.

Members fund testing for the Drupal project. Drupal Association Learn more


Bitvark’s picture

Status: Active » Needs review

Hello, maybe I've the solution.

The bug is in file (in folder user_relationships/user_relationships_rules).
In function user_relationships_rules_rules_event_info() (line 101),
the returned array reports twice as key 'arguments', while It seems it should be 'variables' (on lines 133 and 142).

I changed these two key, flushed my cache, and got the right values on Rules

Simon Georges’s picture

Version: 7.x-1.0-alpha4 » 7.x-1.x-dev
1.43 KB

Proper patch attached. Credits goes to Bitvark.