In researching a problem I was having, I noticed a few improvements that could be made to the webform_client_form() function:
1. The element $form['details']['page_count'] is set twice.
2. The elements $form['details']['email_subject'], email_from_name, and email_from_address are set but never used. These values are re-read from the database during submit.
3. $form['details']['sid'] is passed to validate/submit using a hidden, when a "value" would suffice (and mean a few less bytes being sent to the browser.)
Here's a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform_remove_duplicate_page_count.patch | 661 bytes | quicksketch |
| webform_client_form.patch | 1.71 KB | gribnif |
Comments
Comment #1
quicksketchAll of theses fixes have been added to the 3.x branch, though I've only removed the duplicate $form['details']['page_count'] in the 2.x branch to prevent any sort of API breakage.