Hey! It's me again :)
I get the error described below after a submission of very simple webform (pure markup). This happens on a Drupal7 test system with barely any additional modules (and definetely not webform_validation and webform_rules!)!

* Notice: Undefined index: 1 in webform_get_submission() (line 733 of /var/www/testli/sites/all/modules/webform/includes/webform.submissions.inc).
* Notice: Trying to get property of non-object in webform_get_submission() (line 737 of /var/www/testli/sites/all/modules/webform/includes/webform.submissions.inc).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bfroehle’s picture

Status: Active » Needs review
FileSize
1.29 KB

Both {webform_submissions} and {webform_submitted_data} have 'sid' and 'nid'
fields. If {webform_submitted_data} contains no entries for a particular
submission, then the $result->sid and $result->nid fields were set to NULL
(since no row could be found in {webform_submitted_data}). Restricting the
SELECT to only grab the columns of {webform_submitted_data} we need fixes the
issue.

(This brings the SELECT query in line with the 6.x-3.9 version).

Blooniverse’s picture

Status: Needs review » Reviewed & tested by the community

Great! Works for me.
Sorry, I would have patched myself, but I just don't have the resources to check out every module.

arski’s picture

Priority: Minor » Normal

works for me too, very nice spot!

PS. This issue also comes up if you have a webform with 1 checkbox element that has "0" as the key (I know, one should really not set 0 as select keys, but...) so I'm bumping up the priority a little.

Cheers

quicksketch’s picture

Thanks guys, appreciate the reviews. I'll be sure this gets in new release.

quicksketch’s picture

Title: Undefined index: 1 in webform_get_submission() -- after submitting simple form » Undefined index: 1 in webform_get_submission() after submitting form
Status: Reviewed & tested by the community » Fixed

Committed, thanks again for the reviews and especially @bfroehle for the patch.

Status: Fixed » Closed (fixed)

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

solomojo’s picture

Version: 7.x-3.9 » 7.x-3.13
Status: Closed (fixed) » Needs work
FileSize
26.91 KB

I am still getting this error in version 7.x-3.13. The error didn't occur until after I cleared the submission results. But has persisted ever since. I have tried clearing the submission results again with no luck.

Notice: Undefined index: 5 in webform_get_submission() (line 761 of webroot/sites/all/modules/webform/includes/webform.submissions.inc).
Notice: Trying to get property of non-object in webform_get_submission() (line 765 of webroot/sites/all/modules/webform/includes/webform.submissions.inc). 
OldAccount’s picture

I was getting this error too, after clearing submissions before launching a new e-commerce site. An Ubercart order was trying to access one of the deleted submissions, hence the error. When accessing a different order that has a non-deleted webform submission, there is no error. Not sure if that helps anyone figure this out, but at least the problem is mostly narrowed down.

Vako’s picture

Version: 7.x-3.13 » 7.x-4.0-alpha8
Status: Needs work » Active

I am using Webform 4 alpha and getting the following after a submission:

Notice: Undefined index: {email address} in webform_submission_send_mail() (line 236 of .../sites/all/modules/webform/includes/webform.submissions.inc).
Warning: Invalid argument supplied for foreach() in webform_submission_send_mail() (line 236 of .../sites/all/modules/webform/includes/webform.submissions.inc).

I think it started when I changed the settings and added email settings to the form. Note that the form also is not sending the required email.

quicksketch’s picture

Version: 7.x-4.0-alpha8 » 7.x-3.13

@Vako: That's a separate problem that has been fixed at #2028949: Warning: Invalid argument supplied for foreach() in webform_submission_send_mail().

Considering this issue was against a very old version of Webform (at this point), this issue should probably be closed.

arruk’s picture

Issue summary: View changes

I'm getting this error running against 7.x-3.20 -- I tried upgrading the 7.4 but it broke all existing forms and removed the webform ability from the content type, so I am working to get this version going.

Notice: Trying to get property of non-object in webform_submission_delete() (line 148 of /home/#/www/forms/sites/all/modules/webform/includes/webform.submissions.inc).
Notice: Trying to get property of non-object in webform_submission_delete() (line 154 of /home/#/www/forms/sites/all/modules/webform/includes/webform.submissions.inc).
Notice: Trying to get property of non-object in webform_submission_delete() (line 158 of /home/#/www/forms/sites/all/modules/webform/includes/webform.submissions.inc).

Updated to 3.x-dev didn't fix anything and the patch still fails.

DanChadwick’s picture

Status: Active » Closed (won't fix)

At this point, 7.x-3.x is receiving critical bug fixes only. Please update to 7.x-4.x.