Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
ericmulder1980 CreditAttribution: ericmulder1980 commentedI 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 thatfield_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?
Comment #2
grasmash CreditAttribution: grasmash commentedI'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.
Comment #3
nylin CreditAttribution: nylin commentedI have this issue as well and I can confirm that it appears when calling entity_load(). Is there any progress made on this issue?
Comment #4
Psycle Interactive CreditAttribution: Psycle Interactive commentedI 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.
Comment #5
john.oltman CreditAttribution: john.oltman commentedThis 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.
Comment #6
Psycle Interactive CreditAttribution: Psycle Interactive commentedHi 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.
Comment #7
jmuzz CreditAttribution: jmuzz commentedI don't think this happens in more recent versions.
If it does, please reopen with steps to reproduce.