I installed a fresh D7 core and enabled modules one by one based on dependency.

When tried to create WebForm in add content section. I got following error.
Please see attachment.

Warning: Invalid argument supplied for foreach() in form_builder_webform_form_builder_load() (line 283 of /home/polisp/public_html/sites/all/modules/form_builder/modules/webform/form_builder_webform.module).
Warning: Invalid argument supplied for foreach() in form_builder_webform_form_builder_load() (line 283 of /home/polisp/public_html/sites/all/modules/form_builder/modules/webform/form_builder_webform.module).

Comments

SebCorbin’s picture

Title: Warning: Invalid argument supplied for foreach() in form_builder_webform_form_builder_load() (line 283 of » Invalid argument supplied for foreach() in form_builder_webform_form_builder_load() with unknown types
Assigned: Unassigned » SebCorbin
Status: Active » Needs review
StatusFileSize
new462 bytes

Found the bug, it's pretty simple, but hard to find. Patch attached, please review !

SebCorbin’s picture

Component: Miscellaneous » Webform Itegration

Also, be sure to flush Form Builder cache after applying patch... "TRUNCATE form_builder_cache;"

quicksketch’s picture

Thanks, looks good to me. I'll need to test it out to see if it has any unexpected side-effects. Most forms don't have "unknown" types to begin with, which is the only time this change would be called, so the chances of it affecting existing functionality is quite low.

Pedro Lozano’s picture

I just posted yesterday the same solution at #1479330: Invalid argument supplied for foreach() in element_children() when Hidden components are used.

So feel free to close any of the two issues.

quicksketch’s picture

Status: Needs review » Fixed

Thanks to both of you. I saw this issue a few times though I'm not sure how to reproduce it though. On a form that already had the problem, this cleared it up though. In any case the logic is sound the code makes sense to me. Committed to both branches.

Status: Fixed » Closed (fixed)

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