If a user tries to register with a username that is already in use (regardless of case), the following error is thrown:

"Fatal error. Unsupported operand types in home/public_html/sites/all/modules/workflow_ng/states.module on line 163

Comments

yuriy.babenko’s picture

I'm getting the same error.

yuriy.babenko’s picture

Line 163 is

$user->roles = $user->roles + drupal_map_assoc($edit['roles']);

I printed out $user->roles and drupal_map_assoc($edit['roles']), and saw that $user->roles is simply empty, so I added a check right above it to set it to an empty array:

if(!is_array($user->roles))
   $user->roles = array();

This seems to have fixed it...

fago’s picture

Status: Active » Fixed

hm, I can't reproduce it. Anyway, I've added this check to the state module.

yuriy.babenko’s picture

I'm not sure how to reproduce it, or why it was even happening.

The way I came across is was this: I was browsing administration pages... suddenly I get two drupal errors: one shows a query trying to insert `UID` and `created` data into {users}, with a "duplicate uid" error, and the other something similar from one of my custom modules. I look at my module and that query is under the 'insert' case of hook_user(). I then went to mysite.com/cron.php, and saw the error reported above.

Basically, something was trying to create a new user. Wasn't me, and the site is in development, so there aren't any active users. It's possible that the client was messing with it at the time, but unlikely... weird.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.