I still have this issue.

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

It's only been a problem since I activated this module and started using it.

Comments

ericmulder1980’s picture

I have the exact problem after enabling the field_collection module. I have created a custom entity that is named collection_item so perhaps this is a naming issue?

The issue occurs when loading my entity. When adding ddebug_backtrace() to the load method in entity.controller.inc i can see that field_collection_item_load() is called with my fully loaded collection_item entity as an argument instead of the ID for the field_collection_item.

This causes an error on line 178 of entity.controller.inc :

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

Could it be that field_collection_item and collection_item callbacks are mixed up or perhaps the menu hooks for field_collection_item are fired at the wrong paths?

grasmash’s picture

I'm experiencing the same problem. It occurs when running 'drush search-index' and entity_load() is called for field collections. In my case, name space collisions are not the issue-- my collection is named field_phone.

The error disappears when the field collection is removed from the content type. Removing it isn't really an option for our production site-- but I'm removed it in dev to confirm the source of the problem.

nylin’s picture

I have this issue as well and I can confirm that it appears when calling entity_load(). Is there any progress made on this issue?

Psycle Interactive’s picture

I have this issue with the 7.x-1.0-beta5 release, from what i can see:

The call to DrupalDefaultEntityController->load() expects parameter 1 ($ids) to be any array of entity ids, but for entity reference fields from field collections the entity object is passed instead of the entity id.

Hope this helps to resolve this issue.

john.oltman’s picture

Version: 7.x-1.0-beta4 » 7.x-1.0-beta5

This patch to the Entity module solved the problem for me.

http://drupal.org/node/1003788#comment-6110312

However, I am also using ECK so the problem may be in the way ECK passes values to Entity and not with Field Collection. I haven't been able to pin down which module is at fault.

Psycle Interactive’s picture

Hi John,

No problem i have found the problem and it was nothing to do with the field collections module, was an issue with something i had implemented in a custom module on the site. Took a while to figure it out.
Sorry for the confusion.

jmuzz’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I don't think this happens in more recent versions.

If it does, please reopen with steps to reproduce.