Closed (works as designed)
Project:
Form Builder
Version:
7.x-1.x-dev
Component:
Form Builder Core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2012 at 17:53 UTC
Updated:
26 Sep 2012 at 23:55 UTC
There were several notices so I added some empty checks.
| Comment | File | Size | Author |
|---|---|---|---|
| form_builder_notices.patch | 2.47 KB | indytechcook |
Comments
Comment #1
quicksketchCould you describe when each of these notices occurs?
Comment #2
indytechcook commentedSure, I'm using form_builder an API module and not via webforms. The notices occurred anytime I displayed the form builder UI.
I created http://drupal.org/project/form_builder_field to display the form. It is possible that "I'm Doing it Wrong(tm)"
Oh yeah, great module!
Comment #3
quicksketchI can't see why this patch should be necessary. I'm guessing that Form Builder is encountering an improperly formatted $form variable. In each of the places where you've added a check, it's just after a call to element_children(), which should ensure that the particular key you're checking should exist.
Take form_builder_get_element_types() for example:
And your patch segment:
$form[$key] shouldn't ever be empty to begin with, since you just got back it as an existing key from element_children().
This problem looks like it may be caused by having a FAPI array that looks like this, where not all the children are proper elements:
Or perhaps a simple mistake like this:
Because 'value' doesn't have a hash sign, Drupal will think that 'value' is a sub-field of element1.
I would try printing out your entire FAPI array and also print out the $key value in the places you've patched Form Builder to figure out which $key is giving you an empty value. Then see if that $key relates to a malformed part of your FAPI array.
Comment #4
quicksketchPlease reopen if you can provide more information on when this problem occurs, or if it seems that my guesses in #3 were off mark.