Closed (fixed)
Project:
Form Builder
Version:
7.x-1.0
Component:
Webform Itegration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2012 at 21:35 UTC
Updated:
25 Jul 2012 at 06:18 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchHm, yeah I don't get this error with a basic install of D7, Webform, and Form Builder. Any module that extends Webform in some way beyond the core components probably will not work with Form Builder.
Comment #2
tom verhaeghe commentedI too have this error. It only occurs when the form has not been saved yet. Once I save the form, even if empty, the warning disappears.
Comment #3
quicksketchHi Tom, is it possible to reproduce this problem from a clean install of Drupal and Form Builder?
Comment #4
ryan.armstrong commentedI have this same issue with a clean install, no modules except for webform, options, form builder, and the webform builder UI. I've noticed that it only happens when I try to add invisible element components and then I hit save. Upon hitting save, the invisible component disappears. If I use devel and take a look at the webform node, I can see the hidden component in the node->webform['components']. It looks ot be correct. It's just in the Form Builder UI that it doesn't show up and causes the error. Also the error is on a slightly different line:
Comment #5
tom verhaeghe commentedI'll try. Give me a day :-)
Comment #6
tom verhaeghe commentedI reproduced the error in the following module (see attachment).
I guess the error happens when $form_structure is an empty array (line 29 in formbuilder_error.module). In my module it happens when no form has been saved in my cache table.
Comment #7
quicksketchCould you describe what you mean by "invisible component"? What are these and how do you add one to the form?
Comment #8
quicksketchIf you mean the "Private" option is checked, you may need to make sure that your user account has "Access all webform results" permission. I hadn't thought about this requirement until I put together these two patches, which may also fix the problem. Even though these have to do with page breaks, the code touches on private and conditional components also:
#1507718: Return entire form if $filter = FALSE in webform_client_form() to simplify Form Builder integration
#1507728: Clean up pagebreak code, fixing notices and nested pagebreaks
Comment #9
ryan.armstrong commentedSorry, I am referring to a hidden component. I add them by just dragging over the hidden component from the list of components (like textarea, date, select, etc) onto the form area.
Comment #10
quicksketchThanks for the clarification @ryan.armstrong, I'll try to reproduce it again and see if I can get the error.
Comment #11
damienmckennaI should have explained that on my tests I had about a dozen hidden fields.
Comment #12
ryan.armstrong commentedOn mine I had 4-5 and they were all at the top. Don't think that matters, but I thought I would add it just in case :)
Comment #13
indolering commentedAny updates on this issue?
Comment #14
quicksketchThese patches should solve the problem.
Comment #15
quicksketchD7 patch was bunk, here's the proper one.
Comment #16
quicksketchHaha, D6 patch was also bunk. Geez sorry guys.
Comment #17
quicksketchFix committed to both branches. Unless there is an issue directly with this patch, please keep this issue closed. There are other similar foreach() errors in the queue currently, such as #1510216: Invalid argument webform.components.inc.
Comment #18
damienmckenna@quicksketch: Thanks for tracking this one down!
Comment #20
Pedro Lozano commentedI'm still getting this problem with the latest -dev version.
I'm not totally sure how to reproduce but I'm attaching the patch that fixes it.
Comment #21
Pedro Lozano commentedThis issue seems related. #1553108: Invalid argument supplied for foreach() in form_builder_webform_form_builder_load() with unknown types
Not exactly the same error but the same solution.
Comment #22
quicksketchSince this issue has already had patches applied to it, let's use the issue Pedro pointed out to solve this new problem.