"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.

AttachmentSize
do_not_require_personal_message.patch2.03 KB

#1

derjochenmeyer - September 20, 2009 - 19:07
Title:Allow personal Message requires a Message» "Allow" personal Message "requires" the Message

#2

derjochenmeyer - September 20, 2009 - 19:14

There was one other place that uses...

<?php
variable_get
('forward_allow_message', TRUE)
?>

Modified patch attached.

AttachmentSize
do_not_require_personal_message_2.patch 2.48 KB

#3

seanr - November 3, 2009 - 22:22
Status:needs review» fixed

Duplicate of #511472: Provide option for personal messages to be disabled, enabled, and required, fixed in the next release (later today).

#4

System Message - November 17, 2009 - 22:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.