I'm running into an issue with Workflow Field that is being caused when workflowfield_field_update() is run. It's resaving entire entities instead of just the workflow field and under the right conditions, it will lead to data loss because the entity that it's saving is missing data. I'm not yet clear on why some data is missing.
The exact problem spot is in the submitForm() function in the WorkflowTransitionForm class. The submitForm() function uses entity_save() to make updates to the workflow status field for parent entities.
There's a comment at line 564 that reads "Use field_attach_update for this? Save always?"
I second that thought. While I don't know if field_attach_update() would be sufficient to cover what needs to happen here, I can say that falling back to entity_save() is unsafe and can lead to data loss.
In my case, I'm using file entities and when I replace an existing file entity by uploading a new version to the file entity, file_save() will get triggered and that will in turn trigger hook_field_update() which eventually leads to workflowfield_field_update() being executed.
I also have the organic groups module installed and most of my nodes belong to one or more organic groups. When workflowfield_field_update() is run, the entity that is passed to it is stripped of its organic group references so when entity_save() gets called, every node that references the file loses its organic group associations.
Closed: outdated
2.11
Workflow Field API
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.