From ffc0ea23361e683dba1b8bf3f2147f96737f8bfa Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Tue, 27 Oct 2015 10:21:17 +0000
Subject: [PATCH] Allow visibility without constraints

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

diff --git a/include/class.forms.php b/include/class.forms.php
index 7e092ad9a..019d0cae2 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -3810,6 +3810,10 @@ class VisibilityConstraint {
     }
 
     function emitJavascript($field) {
+
+        if (!$this->constraint->constraints)
+            return;
+
         $func = 'recheck';
         $form = $field->getForm();
 ?>
@@ -3851,6 +3855,12 @@ class VisibilityConstraint {
      * Determines if the field was visible when the form was submitted
      */
     function isVisible($field) {
+
+        // Assume initial visibility if constraint is not provided.
+        if (!$this->constraint->constraints)
+            return $this->initial == self::VISIBLE;
+
+
         return $this->compileQPhp($this->constraint, $field);
     }
 
-- 
GitLab