Postponed
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2012 at 17:36 UTC
Updated:
12 Sep 2018 at 06:53 UTC
Jump to comment: Most recent
When I use the Action 'Fetch entity by property' and select fetch a user by role, when the action is fired I get this error:
Warning: array_values() expects parameter 1 to be array, null given in rules_action_entity_query() (line 56 of /sites/all/modules/contrib/rules/modules/entity.eval.inc).
Any thoughts what might be the issue?
Comments
Comment #1
qasimzee commentedping. exactly facing the same issue
Comment #2
chirhotec commented+1. Same exact problem.
Comment #3
chirhotec commentedA temporary work around I've been able to do is to use Views and Views Rules, to create a list of users filtered by role, and then loop on that list within rules.
Comment #4
maximpodorov commentedFetching users by role is impossible currently. This is Entity API limitation (inability to query user properties which are not stored in users table itself).
Comment #5
maximpodorov commented#2152807: Fetch users by roles
Comment #6
bobfries commentedTo work around this you need to use a component in the rule.... So fetch ALL the users (or in my case I fetched all users by status: Active), then loop them and run a component. Then in the component you can check the user role before doing whatever you need to do.
THE MAIN RULE:
THE COMPONENT:
Comment #7
tr commentedAs noted in #5, this is blocked by #2152807: Fetch users by roles