If you unpublish a node that has a webform entity form attached to it, all submission data associated with that form will be deleted. All rows from webform_submissions, webform_submitted_data, and all field_data_* fields are wiped of their data.

Update:
With a bit more testing, it looks like anytime you save the parent node of webform entity, the webform submitted data is wiped out.

Mikes's patch below does indeed fix this immediate issue. The other issue is what is the hook_node_presave trying to accomplish and why does the hook_node_save not produce the same results?

Comments

MChittenden’s picture

Patch attached.

For what it's worth this affects the multistep branch.

desmondmorris’s picture

Status: Active » Needs review
aaronschachter’s picture

There is also a webform_entity_node_save() function, which executes the same exact code found in webform_entity_node_presave():

if (isset($node->webform['components'][1]) && count($node->webform['components'][1]) == 1) {
  $empty_component = webform_entity_empty_component();
  if ($node->webform['components'][1] == $empty_component) {
      unset($node->webform['components'][1]);
  }
}
desmondmorris’s picture

Issue summary: View changes

Update based on a bit more testing

tizzo’s picture

Issue summary: View changes

We'd need Jody Lynn to weigh in on this, I haven't worked on the multistep branch.

aaronbauman’s picture

Status: Needs review » Needs work

Are people still having this issue?
I cannot reproduce