Download & Extend

Filter settings checkbox cannot be #required

Project:SpamSpan filter
Version:6.x-1.5-beta2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello,

I found that if I want to uncheck the checkbox in SpamSpan module settings page I cannot do so.

Comments

#1

Status:active» postponed (maintainer needs more info)

Could you double check that the SpamSpan checkbox is not able to uncheck because of Checkbox Validate module:

Disable Checkbox Validate module and test to see if the problem is still there, if the checkbox behaves correctly then it is a problem with Checkbox Validate.

#2

Title:Problem with checkbox in SpamSpan - » Filter settings checkbox cannot be #required
Project:Checkbox Validate» SpamSpan filter
Version:6.x-1.1» 6.x-1.5-beta2
Status:postponed (maintainer needs more info)» active

This is plain wrong:

110 $form['spamspan_settings']['spamspan_use_graphic'] = array(
111   '#type' => 'checkbox',
112   '#title' => t('Use a graphical replacement for "@"'),
113   '#default_value' => variable_get('spamspan_use_graphic', 0),
114   '#required' => TRUE,
115   '#description' => t('Replace "@" with a graphical representation when javascript is disabled (and ignore the setting "Replacement for @" above).')
116 );

An administrative module settings checkbox cannot be required. I can only guess that this is a copy+paste error.

#3

I second that, Robert, I also had to modify the code to remove the #required attribute. This is not a Checkbox Validate issue. A checkbox never can be required by definition because it denotes an optional item that the user is allowed to leave emtpy. The core Drupal bug that forgets to validate checkboxes, the bug that Checbox Validate is written to fix, allows you to get away with this incorrect semantics without that additional module but that doesn't shift the responsibility to Checkbox Validate. Make sure you never #require a checkbox, plain and simple, because it is logically incorrect to do so.

Bye,

#4

Fixed in 6--1.5. Thanks

#5

Status:active» closed (fixed)