[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: Boolean: form sends '' for null value

git at icinga.org git at icinga.org
Wed May 25 11:25:27 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch
Commit: 0ce8a29b52596f855e2ff13a3c65ec210cc2b09b
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=0ce8a29b52596f855e2ff13a3c65ec210cc2b09b

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue May 24 19:59:02 2016 +0200

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 84a9947..384bc98 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);



More information about the icinga-checkins mailing list