From 0ce8a29b52596f855e2ff13a3c65ec210cc2b09b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 24 May 2016 19:59:02 +0200 Subject: [PATCH] Boolean: form sends '' for null value --- library/Director/Web/Form/Element/Boolean.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/Director/Web/Form/Element/Boolean.php b/library/Director/Web/Form/Element/Boolean.php index 84a9947d..384bc982 100644 --- a/library/Director/Web/Form/Element/Boolean.php +++ b/library/Director/Web/Form/Element/Boolean.php @@ -33,6 +33,7 @@ class Boolean extends ZfSelect return $value === 'y' || $value === 'n' || $value === null + || $value === '' || $value === true || $value === false; } @@ -43,6 +44,8 @@ class Boolean extends ZfSelect $value = 'y'; } elseif ($value === false) { $value = 'n'; + } elseif ($value === '') { + $value = null; } return parent::setValue($value);