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 &#039;)&#039; 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

jdwfly’s picture

Version: 6.x-1.0 » 6.x-1.1
Component: Rules Core » Rules Engine

This still occurs in 1.1 as well.

jdwfly’s picture

Category: bug » support
Status: Active » Closed (fixed)

Closing. Don't need the help any more.