"Allow" personal Message "requires" the Message
derjochenmeyer - September 20, 2009 - 19:06
| Project: | Forward |
| Version: | 6.x-1.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
in forward_form the message textarea is set required:
<?php
if (variable_get('forward_allow_message', TRUE)) {
$form['message']['message'] = array(
'#type' => 'textarea',
'#title' => t('Your Personal Message'),
'#default_value' => '',
'#cols' => 50,
'#rows' => 10,
'#description' => '',
'#required' => TRUE,
);
}
?>This piece of code from the validate functions makes it even impossible to override the settings with hook_form_alter
<?php
if ((variable_get('forward_allow_message', TRUE)) && (empty($form_state['values']['message']))) {
form_set_error('message', t('You must enter a message.'));
}
?>Attached patch introduces a new setting & variable "forward_allow_message" and fixes the validation function.
| Attachment | Size |
|---|---|
| do_not_require_personal_message.patch | 2.03 KB |

#1
#2
There was one other place that uses...
<?phpvariable_get('forward_allow_message', TRUE)
?>
Modified patch attached.
#3
Duplicate of #511472: Provide option for personal messages to be disabled, enabled, and required, fixed in the next release (later today).
#4
Automatically closed -- issue fixed for 2 weeks with no activity.