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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bitvark’s picture

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

Simon Georges’s picture

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

Proper patch attached. Credits goes to Bitvark.

alex.skrypnyk’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This has been used in prod for the last 2 years