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).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | form_builder-1553108-unknown_types.patch | 462 bytes | SebCorbin |
| 1335706967127-webform_error.png | 57.52 KB | monsoon |
Comments
Comment #1
SebCorbin commentedFound the bug, it's pretty simple, but hard to find. Patch attached, please review !
Comment #2
SebCorbin commentedAlso, be sure to flush Form Builder cache after applying patch... "TRUNCATE form_builder_cache;"
Comment #3
quicksketchThanks, 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.
Comment #4
Pedro Lozano commentedI 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.
Comment #5
quicksketchThanks 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.