When I try to edit and update a node with a field collection item, the node title sometimes didn't get updated. This however doesn't happen to body or other fields. Some investigation & debug led me to following logic:
1. i18n_node_form_submit -> node_save -> field_attach_update -> field_collection_field_update -> deleteRevision -> deleteHostEntityReference -> entity_save.
2. entity_save saves a node which is loaded with entity_load_single and when the node is not permanently saved to the database yet (the transaction in node_save is not finished yet), an outdated version of node is used and wrong node title is updated (the old title).
The node in question doesn't have revision and many others don't have either but this error didn't happen to them. Any clue about how to fix this?
Comments
Comment #1
ngocketit CreditAttribution: ngocketit commentedSeems to be a duplicated issue: https://drupal.org/node/2052997
Comment #2
ngocketit CreditAttribution: ngocketit commentedA possible hot fix (not to field collection code) is to implement another form submit handler, check if the node title is changed and update it. Here is an example:
Comment #3
jmuzz CreditAttribution: jmuzz commentedShould be working in latest version.