Closed (fixed)
Project:
Rules
Version:
6.x-1.1
Component:
Rules Engine
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2009 at 17:08 UTC
Updated:
5 May 2010 at 22:09 UTC
Basically the rule checks for a certain role upon login. If the user has that role then the role is removed. The rule seems to work because the role does get removed from the user, but I get these errors in the log. My rule is also exported below.
#1
array_fill() [<a href='function.array-fill'>function.array-fill</a>]: Number of elements must be positive in /includes/database.inc on line 241.
#2
implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in /includes/database.inc on line 241.
#3
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /modules/user/user.module on line 502.
My simple rule
array (
'rules' =>
array (
'rules_3' =>
array (
'#type' => 'rule',
'#set' => 'event_user_login',
'#label' => 'Make user authenticated',
'#active' => 1,
'#weight' => '0',
'#categories' =>
array (
),
'#status' => 'custom',
'#conditions' =>
array (
0 =>
array (
'#info' =>
array (
'label' => 'User has role of Applicant',
'label callback' => false,
'arguments' =>
array (
'user' =>
array (
'type' => 'user',
'label' => 'User',
),
),
'module' => 'User',
),
'#name' => 'rules_condition_user_hasrole',
'#settings' =>
array (
'roles' =>
array (
0 => 3,
),
'operation' => 'OR',
'#argument map' =>
array (
'user' => 'account',
),
),
'#type' => 'condition',
'#weight' => 0,
),
),
'#actions' =>
array (
0 =>
array (
'#weight' => 0,
'#info' =>
array (
'label' => 'Remove user role',
'arguments' =>
array (
'user' =>
array (
'type' => 'user',
'label' => 'User whos roles should be changed',
),
),
'module' => 'User',
),
'#name' => 'rules_action_user_removerole',
'#settings' =>
array (
'roles' =>
array (
0 => 3,
),
'#argument map' =>
array (
'user' => 'account',
),
),
'#type' => 'action',
),
),
),
),
'rule_sets' =>
array (
),
)
Comments
Comment #1
jdwfly commentedThis still occurs in 1.1 as well.
Comment #2
jdwfly commentedClosing. Don't need the help any more.