field_collection_item not updating / old data preserved
I would love to tell you why, but I have not been able to figure it out: I just know it works.

Initially I executed the code above in hook_node_presave($node), but obviously it did not work.  So I figured I should try hook_node_update($node) - but that did not work either.  

Then I discovered drupal_register_shutdown_function and now my hook_node_update looks like this: 

function mymodule_node_update($node) {
  if ($node-&gt;type === 'node_type') {
    drupal_register_shutdown_function('_update_from_sync_fields', $node);
  }
}


node_type is the type of node I am checking against.  Any case, once the node is actually saved - that is all processing is done, db transactions completed, etc - drupal will call my shutdown function.  Now when I update the field values, and in specific field-collection fields - they are saved.

Of-course saving these fields and calling: 

  field_attach_update('node', $node);
  field_attach_presave('node', $node);
  entity_get_controller('node')-&gt;resetCache([$node-&gt;nid]);


at the end of my shut-down function triggers hook_node_update again, but fortunately I have a token that tells me - so I do not execute the code again.

This solution works - what I am not happy about is the fact that it executes when Drupal is shutting down.

I think the problem is related to the fact that node_save starts a DB transaction, and when I update related entity (field-collection) items in hook_node_save or hook_node_presave I am starting another (nested) transaction.  Clearly my transaction updating field-collection items completes, but when the outer (first) transaction then complete, it is writing old/dirty data.

The trick is going to be to clear the dirty data from cache.  I was hoping entity_get_controller('node')-&gt;resetCache([$node-&gt;nid]); would do that - but clearly it does not?

So next I changed the hook_node_update to :

function mymodule_node_update($node) {
  if ($node-&gt;type === 'node_type') {
    _update_from_sync_fields ($node);
  }
}


in other words - from hook_node_update I simply call the 'shut-downfunction, then I rebuilt the drupal registry (drush rr`) and voila - it worked.  Now I am even more confused.  It is possible that my original code worked all along, but there was something wrong with the registry (or caches).  All things being equal, all the examples I read was right.  

From hook_node_update, load the field collection entity, update and save the entity.  The clear the caches and do a field_attached_presave and field_attached_update like so:

  entity_get_controller('node')-&gt;resetCache([$node-&gt;nid]);
  field_attach_presave('node', $node);
  field_attach_update('node', $node);