The results from the webform submission being an empty array rather than a stdclass object on save of a draft in the hook_submit function.

CommentFileSizeAuthor
#4 webform_entity-draft_saving-1328538-4.patch601 bytesIztok
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tizzo’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

skylord’s picture

Version: » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (fixed) » Needs work

BTW, as for Webform 4.x $form['#submission'] is 'FALSE' for drafts, so fix is slightly different i.e:

--- webform_entity.module.orig2 2014-07-11 03:31:53.000000000 +0400
+++ webform_entity.module       2014-07-11 10:02:22.000000000 +0400
@@ -493,7 +493,7 @@
 function webform_entity_webform_submission_submit(&$form, &$form_state) {
   if (in_array($form['#node']->type, array_keys(webform_entity_get_types()))) {
     $submission =& $form['#submission'];
-    if (!is_object($submission) && is_array($submission)) {
+    if ((!is_object($submission) && is_array($submission)) || empty($submission)) {
       $submission = new stdclass;
       $submission->bundle = $form['#node']->type;
     }
Iztok’s picture

A patch file for the fix

wgallop99’s picture

This worked for me! Thanks for the patch.