I'm nut sure what is going on - can someone help or advise please? Thanks

* Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/ribarn01/public_html/includes/entity.inc).
* Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /home/ribarn01/public_html/includes/entity.inc).

Comments

fago’s picture

Category: bug » support
Status: Active » Fixed

This error is not related to the entity API module, but to the core entity API and usually caused by a module calling entity_load() with an integer/string instead of an array for the $id parameter.

mgifford’s picture

I ran into the same issue. Any idea about how to go about resolving it? I'm not sure how this module is different than the core entity API.

femrich’s picture

Seems to be an issue of needing to adapt code from drupal 6 to new requirements of drupal 7. Also seems to be affecting a number of contrib modules. Have yet to see anyone actually fix it. I was given a link to this explanation: http://stackoverflow.com/questions/4798047/array-flipcan-only-flip-strin...

Status: Fixed » Closed (fixed)

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

klausi’s picture

Version: 7.x-1.0-beta6 » 7.x-1.x-dev
Category: support » bug
Status: Closed (fixed) » Needs review
StatusFileSize
new730 bytes

Ran into this issue as well, traced it down to EntityFieldHandlerHelper::extract_property_multiple(). If it gets passed some invalid/stale wrappers it calls entity_load() incorrectly with FALSE values. Yes, there might be another problem going on here, but the entity API should also make sure to call other functions correctly. Encountered this problem with the search_api Views integration, re-Indexing all entites helped.

Patch attached.

klausi’s picture

StatusFileSize
new767 bytes

Whoops, of course that other line needs to be removed.

klausi’s picture

StatusFileSize
new831 bytes

New patch with a longer comment. I debugged this issue and it occurred on empty field collection fields, where the entity value is NULL (field collection does not exist) and therefore the id is returned as FALSE.

fago’s picture

Title: Function array-flip error on my front page » array_flip warnings appear in data-selection views
Status: Needs review » Fixed

Thanks, looks good to me. Committed.

Status: Fixed » Closed (fixed)

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