Answers.Body: <p>It looks like a fix for this issue has been committed to the webform_civicrm project and should be present in version 7.x-4.21+</p>
  
  <p>Details are here: <a href="https://www.drupal.org/project/webform_civicrm/issues/2966760" rel="nofollow noreferrer">https://www.drupal.org/project/webform_civicrm/issues/2966760</a></p>
  
  <p>The fix itself is here: <a href="https://github.com/colemanw/webform_civicrm/pull/139" rel="nofollow noreferrer">https://github.com/colemanw/webform_civicrm/pull/139</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-17T20:19:37.720Z
Answers.LastActivityDate: 2018-10-17T20:19:37.720Z
Answers.UserDisplayName: HomoTechsual
Body: <p>Running into this problem in a form to create an activity with two existing contacts.  The form creates the activity successfully, but the UX is marred by angry red error messages.  I replicated the problem in a test form with nothing but one existing contact.  This test form is accessible at <a href="http://cc.unidosnow.org/node/7?cid1=200" rel="nofollow noreferrer">http://cc.unidosnow.org/node/7?cid1=200</a>.    Submitting the test form results in similar error messages as seen with the full fledged form:</p>
  
  <ul>
  <li>Notice: Undefined index: address in wf_crm_webform_postprocess->saveContactLocation() (line 751 of /home/unidosnow/www/www/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc).</li>
  <li>Notice: Undefined index: email in wf_crm_webform_postprocess->saveContactLocation() (line 752 of /home/unidosnow/www/www/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc).</li>
  </ul>
  
  <p>Seems to be wanting address and email (to enable contact creation?), but the only thing checked in the webform's CiviCRM tab is Existing Contact and that's all I need from the contacts in the full fledged form.</p>
  
  <p>I am running CiviCRM 7.x-4.7.29, Drupal 7.58, Webform 7.x-4.16, Webform CiviCRM Integration 7.x-4.20, PHP 5.6.</p>
  
  <p>Thoughts?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-26T14:29:54.523Z
Comments.Text: I am having exactly the same problem! I am using the webform to create a new case using an existing contact. All the values are stored correctly when submitted but I don't want to show the user the ugly message!
Comments.UserDisplayName: Ben
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-15T11:23:40.440Z
Comments.Text: Ben's case - https://www.drupal.org/project/webform_civicrm/issues/2966760
Comments.UserDisplayName: wil_SRQ
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-15T21:03:20.487Z
Comments.Text: Same message here on creation of new activity.
Comments.UserDisplayName: pmoz
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-21T16:03:23.960Z
Comments.Text: I'm seeing a similar error with a form which is just a mailing group subscription form with a couple of additional custom fields - as a workaround I included an address field and changed that field to hidden - the php notice isn't triggered, and the form doesn't try to fill in the address.
Comments.UserDisplayName: liblogger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-21T20:04:40.143Z
Comments.Text: I also resorted to that workaround.
Comments.UserDisplayName: wil_SRQ
Tags: <webform-civicrm>
Title: Webform with existing contact results in undefine index
ThreadText: # Webform with existing contact results in undefine index
  
  (Asked by: username_0 on 2018-04-24)
  
  Running into this problem in a form to create an activity with two existing contacts. The form creates the activity successfully, but the UX is marred by angry red error messages. I replicated the problem in a test form with nothing but one existing contact. This test form is accessible at <http://cc.unidosnow.org/node/7?cid1=200>. Submitting the test form results in similar error messages as seen with the full fledged form:
  
  * Notice: Undefined index: address in wf\_crm\_webform\_postprocess->saveContactLocation() (line 751 of /home/unidosnow/www/www/sites/all/modules/webform\_civicrm/includes/wf\_crm\_webform\_postprocess.inc).
  * Notice: Undefined index: email in wf\_crm\_webform\_postprocess->saveContactLocation() (line 752 of /home/unidosnow/www/www/sites/all/modules/webform\_civicrm/includes/wf\_crm\_webform\_postprocess.inc).
  
  Seems to be wanting address and email (to enable contact creation?), but the only thing checked in the webform's CiviCRM tab is Existing Contact and that's all I need from the contacts in the full fledged form.
  
  I am running CiviCRM 7.x-4.7.29, Drupal 7.58, Webform 7.x-4.16, Webform CiviCRM Integration 7.x-4.20, PHP 5.6.
  
  Thoughts?
  
  **Tags:** webform-civicrm
  
  > **Comments:**
  > **username_1**: I am having exactly the same problem! I am using the webform to create a new case using an existing contact. All the values are stored correctly when submitted but I don't want to show the user the ugly message!  
  > **username_0**: Ben's case - https://www.drupal.org/project/webform_civicrm/issues/2966760  
  > **username_2**: Same message here on creation of new activity.  
  > **username_3**: I'm seeing a similar error with a form which is just a mailing group subscription form with a couple of additional custom fields - as a workaround I included an address field and changed that field to hidden - the php notice isn't triggered, and the form doesn't try to fill in the address.  
  > **username_0**: I also resorted to that workaround.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2018-10-17. Score: 1
  
  It looks like a fix for this issue has been committed to the webform\_civicrm project and should be present in version 7.x-4.21+
  
  Details are here: <https://www.drupal.org/project/webform_civicrm/issues/2966760>
  
  The fix itself is here: <https://github.com/colemanw/webform_civicrm/pull/139>
  
  
  ---
  
  