tablefield_form_alter() runs for every form on every page. It invokes field_info_instance() for every form and field_info_field() for every table field for every form, even when the form doesn't contain the table field.
Using information saved in $form_state['field'] by the field system it is possible to prevent database calls caused by tablefield_form_alter() on pages that have no table field.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2992511-tablefield-optimize-form-alter-3.patch | 1.82 KB | Jorrit |
| #2 | 2992511-tablefield-optimize-form-alter-2.patch | 1.8 KB | Jorrit |
Comments
Comment #2
Jorrit commentedPlease see the attached patch.
Comment #3
Jorrit commentedFixed a notice.
Comment #5
lolandese commentedPatch: