I have created field collection and added it to my content type. I have created a node, and now user can add field collections on this node. But i need to write into a file(some stuff) when user added
new field collection or updated it. I need something like hook_node_insert
and hook_node_update
, i cant find anything for field collection.
In preprocess_node i have outputed field_collection_field
and its returns only ids
, and i can get them only by this code:
$field_ids = array();
//context_node = my current node,
//field_block_id == field collection field
foreach ($context_node->field_block_id['und'] as $element) {
$field_ids[] = $element['value'];
}
$field_collection = entity_load('field_collection_item', $field_ids);
dpm($node);
your hook_node_insert ?