Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#7 | undefined_index.PNG | 26.91 KB | solomojo |
#1 | 1087856-Fixed-undefined-index-1-in-webform_get_submi.patch | 1.29 KB | bfroehle |
Comments
Comment #1
bfroehle CreditAttribution: bfroehle commentedBoth {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).
Comment #2
Blooniverse CreditAttribution: Blooniverse commentedGreat! Works for me.
Sorry, I would have patched myself, but I just don't have the resources to check out every module.
Comment #3
arski CreditAttribution: arski commentedworks 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
Comment #4
quicksketchThanks guys, appreciate the reviews. I'll be sure this gets in new release.
Comment #5
quicksketchCommitted, thanks again for the reviews and especially @bfroehle for the patch.
Comment #7
solomojo CreditAttribution: solomojo commentedI 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.
Comment #8
OldAccount CreditAttribution: OldAccount commentedI 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.
Comment #9
Vako CreditAttribution: Vako commentedI am using Webform 4 alpha and getting the following after a submission:
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.
Comment #10
quicksketch@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.
Comment #11
arruk CreditAttribution: arruk commentedI'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.
Comment #12
DanChadwick CreditAttribution: DanChadwick commentedAt this point, 7.x-3.x is receiving critical bug fixes only. Please update to 7.x-4.x.