For reference, this is the D7 code for this:

/**
 * Implements hook_devel_generate().
 */
function field_collection_devel_generate($object, $field, $instance, $bundle) {
  // Create a new field collection object and add fake data to its fields.
  $field_collection = entity_create('field_collection_item', array('field_name' => $field['field_name']));
  $field_collection->language = $object->language;
  $field_collection->setHostEntity($instance['entity_type'], $object, $object->language, FALSE);

  devel_generate_fields($field_collection, 'field_collection_item', $field['field_name']);

  $field_collection->save(TRUE);

  return array('value' => $field_collection->item_id);
}

Comments

jmuzz created an issue. See original summary.

jmuzz’s picture

Version: 8.x-1.x-dev » 8.x-3.x-dev

Development is moving to 8.x-3.x.

ram4nd’s picture

Status: Active » Closed (won't fix)