When an entity is loaded that contains field collections, how can you have all the field collection entities loaded into the host entity instead of just their item IDs? Is there a quick workaround I can add to my entity load functions (inside Entity API)?

Comments

etibmw’s picture

hey kevinquillen,
i am facing the same problem, did you get this to work?
any help will be grate
eti

jmuzz’s picture

Issue summary: View changes
Status: Active » Fixed

I wouldn't say there is a quick solution, but it is possible. Depending on how general you need it to be you can load code it to load the fields you know are field collections or you can use the values in the field_config table or use the Field Info API to determine which fields are field collections and then load them into the field data. The module already does something like this to handle the creation of Field Collection Items in the embedded form so it should be pretty harmless, just don't replace the 'value' or 'revision_id' with the entity but make your own name for it like 'loaded_entity' .

Status: Fixed » Closed (fixed)

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