From f5582a2ebf3637cc944ea30d0563219a150631f5 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 18 Mar 2015 10:55:56 -0500
Subject: [PATCH] forms: Fix unset of all checkboxes on a form

---
 include/class.forms.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/class.forms.php b/include/class.forms.php
index 7078692a0..5ac0738d6 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -1948,8 +1948,11 @@ class CheckboxWidget extends Widget {
 
     function getValue() {
         $data = $this->field->getSource();
-        if (count($data))
+        if (count($data)) {
+            if (!isset($data[$this->name]))
+                return false;
             return @in_array($this->field->get('id'), $data[$this->name]);
+        }
         return parent::getValue();
     }
 
-- 
GitLab