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.

Files: 
CommentFileSizeAuthor
#2 user_relationships_1487758_arguments_to_variables_2.patch1.43 KBSimon Georges
PASSED: [[SimpleTest]]: [MySQL] 1,047 pass(es).
[ View ]

Comments

Status:Active» Needs review

Hello, maybe I've the solution.

The bug is in file user_relationships_rules.rules.inc (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

Version:7.x-1.0-alpha4» 7.x-1.x-dev
StatusFileSize
new1.43 KB
PASSED: [[SimpleTest]]: [MySQL] 1,047 pass(es).
[ View ]

Proper patch attached. Credits goes to Bitvark.