[icinga-checkins] icinga.org: icingaweb2-module-director/master: Boolean: fix multiedit-related issues

git at icinga.org git at icinga.org
Tue Dec 13 16:04:33 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: c1e80afff4935521338dde847876f02521eb3621
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=c1e80afff4935521338dde847876f02521eb3621

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Dec 13 16:04:09 2016 +0100

Boolean: fix multiedit-related issues

fixes #13131

---

 library/Director/Web/Form/Element/Boolean.php |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/library/Director/Web/Form/Element/Boolean.php b/library/Director/Web/Form/Element/Boolean.php
index 384bc98..60f30b8 100644
--- a/library/Director/Web/Form/Element/Boolean.php
+++ b/library/Director/Web/Form/Element/Boolean.php
@@ -28,14 +28,17 @@ class Boolean extends ZfSelect
         return null;
     }
 
-    public function isValid($value, $context = null)
+    protected function _filterValue(&$value, &$key)
     {
-        return $value === 'y'
-            || $value === 'n'
-            || $value === null
-            || $value === ''
-            || $value === true
-            || $value === false;
+        if ($value === true) {
+            $value = 'y';
+        } elseif ($value === false) {
+            $value = 'n';
+        } elseif ($value === '') {
+            $value = null;
+        }
+
+        parent::_filterValue($value, $key);
     }
 
     public function setValue($value)



More information about the icinga-checkins mailing list