Answers.Body: <p>It turned out to be a problem with Custom Data (civicrm/admin/custom/group). A Set of Custom Fields had been created for participants without any fields added. I removed the group and problem is fixed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-10T15:46:57.460Z
Answers.Text: Ok phew! Glad to see you solved this.
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-26T17:00:38.120Z
Answers.Text: The answer was so very helpful to me. Thanks for reporting how you resolved it!
Answers.UserDisplayName: EricLB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-10T11:59:59.550Z
Answers.LastActivityDate: 2018-10-10T11:59:59.550Z
Answers.UserDisplayName: Ben
Body: <p>I am getting this error at the top of a webform (in the civi section):</p>
  
  <p>Warning: Invalid argument supplied for foreach() in wf_crm_admin_form->buildParticipantTab() (line 930 of /home/site1/public_html/sites/all/modules/webform_civicrm/includes/wf_crm_admin_form.inc).</p>
  
  <p>It happens when a contact is added to an event. I have attached a screen capture. </p>
  
  <p>A new part in the form has appeared. No idea where from. I think this might be causing the issue. See attached for for more information.  </p>
  
  <p><a href="https://i.sstatic.net/PKQ55.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PKQ55.jpg" alt="enter image description here"></a></p>
  
Tags: <civievent><webform-civicrm>
Title: Webform error for event registration - Invalid argument supplied for foreach()
ThreadText: # Webform error for event registration - Invalid argument supplied for foreach()
  
  (Asked by: username_0 on 2018-10-10)
  
  I am getting this error at the top of a webform (in the civi section):
  
  Warning: Invalid argument supplied for foreach() in wf\_crm\_admin\_form->buildParticipantTab() (line 930 of /home/site1/public\_html/sites/all/modules/webform\_civicrm/includes/wf\_crm\_admin\_form.inc).
  
  It happens when a contact is added to an event. I have attached a screen capture.
  
  A new part in the form has appeared. No idea where from. I think this might be causing the issue. See attached for for more information.
  
  [![enter image description here](https://i.sstatic.net/PKQ55.jpg)](https://i.sstatic.net/PKQ55.jpg)
  
  **Tags:** civievent, webform-civicrm
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-10-10. Score: 3
  
  It turned out to be a problem with Custom Data (civicrm/admin/custom/group). A Set of Custom Fields had been created for participants without any fields added. I removed the group and problem is fixed.
  
  > **Comments:**
  > **username_1**: Ok phew! Glad to see you solved this.  
  > **username_2**: The answer was so very helpful to me. Thanks for reporting how you resolved it!  
  
  ---
  
  