Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | user_relationships_1487758_arguments_to_variables_2.patch | 1.43 KB | Simon Georges |
Comments
Comment #1
Bitvark CreditAttribution: Bitvark commentedHello, 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
Comment #2
Simon Georges CreditAttribution: Simon Georges commentedProper patch attached. Credits goes to Bitvark.
Comment #3
alex.skrypnykThis has been used in prod for the last 2 years