Support for Devel Generate was added in [1236402] but it does not work.
Modules:
Devel generate 7x-1.2
Entity 7x-1.0-rc3
Field Collection 7.x-1.0-beta4
How to reproduce:
1. Create a node bundle with a field collection field
2. Add fields to the field collection. In my case: text field, 2 term references & Link field
3. Enable devel generate
4. Generate a few nodes
5. Edit/view the nodes and observe that the field collection field is empty.
Under the hood
When I look at the database, I notice that:
1. The entities are created in field_collection_item table
2. The field_data_field_* tables of the field instances attached to the field_collection_item entity are empty or don't contain generate data
3. The field_data_field_* table of the field collection instance does not contain a reference between the host entity and the field collection entity
I've also taken a look at the field_collection_devel_generate() hook. The code looks sane and the field_collection item gets properly build. devel_generate_fields add fields with random generated data to the object. Yet, field_collection->save(TRUE) does not seem to save the collection entirely.
When I pass FALSE to save(), the field reference between the entity and the host entity does get saved, but the generate field data attached to the entity still isn't stored. On the edit form, the node will have a field_collection field with as many items as there have been created, yet their fields will be empty.
Comments
Comment #1
netsensei commentedFurther narrowed this down: the issue only rears its head in combination with i18n and content types where translation is enabled. Devel generate works correct when nodes are language undefined.
Comment #2
joshf commentedIs https://drupal.org/node/1236402 related to this?