From 771e93ef18858a0a4ab1088d0678ce9e4fca75df Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Mon, 23 May 2011 20:36:20 +1200 Subject: [PATCH] BUGFIX: return null data from checkbox field if not set. Fixes issue with validation using str_len() to determine valid field. FIXES: http://open.silverstripe.org/ticket/6231. Thanks natmchugh --- forms/CheckboxField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms/CheckboxField.php b/forms/CheckboxField.php index 0e5434f9c..8cbc2a92e 100755 --- a/forms/CheckboxField.php +++ b/forms/CheckboxField.php @@ -13,7 +13,7 @@ class CheckboxField extends FormField { } function dataValue() { - return ($this->value) ? 1 : 0; + return ($this->value) ? 1 : NULL; } function Value() {