I am getting this error message whenever I go from any user account node back to any other node. I've tried this with Drupal 7 beta 3 and the latest snapshot, used all default themes with the same result. It's just when I leave the user account node that I get the error.

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 167 of E:\Program Files (x86)\Wamp\wamp\www\Drupal7b3\includes\entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 343 of E:\Program Files (x86)\Wamp\wamp\www\Drupal7b3\includes\entity.inc).

Comments

berdir’s picture

Status: Active » Postponed (maintainer needs more info)

Check the contrib modules you are using..

Disable one after another until you found which one causes this and then move the issue to that queue.

This is most likely not a core issue.

nightowl77’s picture

Version: 7.0-beta3 » 7.0

@Old Man: I had the exact same problem and tracked it down to page_title. If you are using page_title see my solution here:

http://drupal.org/node/1018280#comment-3919190

If this is indeed your problem (and not maybe another module) you should move this issue to the page_title issue queue and mark it as a duplicate of #1018280: Warning: array_flip() entity.inc

eresik’s picture

Previously, errors have been if moving from /blog/1 to /blog

Perhaps this is a bad solution, but I did this:
I changed the file "entity.php" rows

if ($ids) {
$entities += array_intersect_key($this->entityCache, array_flip($ids));
}

to

if (($ids) && (!is_array(reset($ids)))) {
$entities += array_intersect_key($this->entityCache, array_flip($ids));
}

AND

$passed_ids = !empty($ids) ? array_flip($ids) : FALSE;

to

$passed_ids= ((!empty($ids)) && (!is_array(reset($ids)))) ? array_flip($ids) : FALSE;

And while not getting "array_flip()" error messages.

berdir’s picture

Instead of that, I suggest that you simply add a temporary check to see if it is an array and if yes, use ddebug_backtrace() (or debug_print_backtrace() if you don't have devel.module but the first one is *way* easier to read) to find which module is calling a *_load() function with the wrong arguments.

What you are doing just hides the warnings, but they are shown for a reason: Someone is using the API wrong.

eresik’s picture

Thanks.
Error was in module "Page title"

wmstonetn’s picture

I found the same problem as above and confirm the problem is being caused by the Page Title module. Removed the module and the error went away.

See this thread in Page Title - http://drupal.org/node/1109106

jasonabc’s picture

Confirmed - removed Page Title module and error went away. Upgraded to latest Dev of that module and that fixed it.

berdir’s picture

Status: Postponed (maintainer needs more info) » Fixed

Setting this to fixed then after multiple confirmations that this is caused by Page Title module.

Status: Fixed » Closed (fixed)

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