Hey everyone,

When switching to another user using the Masquerade block, I'm receiving the following error message at the top of the page:

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 104 of /home/sandboxes/sandbox10/public_html/includes/entity.inc).

Despite the error message, I'm able to successfully switch to another user. So the error message doesn't appear to affect any functionality. But any ideas why it is occurring?

Thanks,
Ben

P.S. I'm using Drupal 7.0-alpha5.

Comments

BenK’s picture

Title: Error Message When Switching to Another User » D7: Error Message When Switching to Another User
deekayen’s picture

Entities can be users in D7, so I suspect this is happening in masquerade_switch_user(), and more specifically at $new_user = user_load($uid); since that's the only load function in there. What's puzzling to me is that there's a is_numeric() before it gets to the user_load(), so perhaps it's not erroring in the switch_user() function at all...

deviantintegral’s picture

There are a few places where we do user_load($username) instead of user_load_by_name($username). That's probably part of the issue.

http://api.drupal.org/api/function/user_load_by_name/7

andypost’s picture

deekayen’s picture

Status: Active » Closed (duplicate)