Attached is the array created by drupal_get_form (printed with print_r) for a simple set of checkboxes made using the options widget. Also attached is the HTML produced by running drupal_render against the form array.
Notice that the array (check_form.txt) is 995 lines, while the actual HTML form (check_render.txt) is 23 lines. I have a lot to say, but the fact that a simple set ofcheckboxes made with the options widget creates a form array of nearly 1,000 lines almost speaks for itself.
This came out of some work I was doing for #569542: Button Option Field is Required, has One Option - Select that Option. There were some failed test cases (which seem to be caused by field_update_field not working) I was diagnosing when I came across this.
| Comment | File | Size | Author |
|---|---|---|---|
| check_render.txt | 1.79 KB | Mike Wacker | |
| check_form.txt | 34.48 KB | Mike Wacker |
Comments
Comment #1
bjaspan commentedVery little of this is related to Field API; it is just a by-product of the way Form API works. Consider: The following part of the form structure turns into *nothing* in the rendered output, yet is a critical part of the form:
The next excerpt turns into, approximately, "<input type="hidden" name="form_build_id" "value"="form-8686652c810fe391fabeaff03fae46bd" id="form-8686652c810fe391fabeaff03fae46bd" />>":
This is not a bug.