Personal Message Field Validation Does not Respect #required
populist - April 16, 2008 - 18:59
| Project: | Forward |
| Version: | 5.x-1.12 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
The personal message field of the forward form is set to #required = 1 in the form definition. However, in the forward_form_validate there is an additional validation check ala: if (!$form['message']) { form_set_error('message', t('You must enter a message.')); }. This prevents a hook_form_alter from setting the #required bit to 0 because the secondary check will still make the field required. This patch just removes the secondary check. The only downside here is that the error message is not as nice as before ("You must enter a message" versus "Your Personal Message field is required.").
| Attachment | Size |
|---|---|
| forward_message_require.patch | 343 bytes |

#1
Fixed in CVS DRUPAL-5, will be in the next release.
#2
Automatically closed -- issue fixed for 2 weeks with no activity.