From efb0452bd96773297596c1aa5f71cbb9549d7844 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Fri, 27 May 2016 14:23:18 +0000
Subject: [PATCH] bug: Add Missing Fields

Set _value in DynamicFormEntryAnswer even when value is empty.
---
 include/class.dynamic_forms.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 6131a294b..bde36701d 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -1347,11 +1347,13 @@ class DynamicFormEntryAnswer extends VerySimpleModel {
     }
 
     function getValue() {
-        if (!isset($this->_value) && isset($this->value)) {
+
+        if (!isset($this->_value)) {
             //XXX: We're settting the value here to avoid infinite loop
             $this->_value = false;
-            $this->_value = $this->getField()->to_php(
-                $this->get('value'), $this->get('value_id'));
+            if (isset($this->value))
+                $this->_value = $this->getField()->to_php(
+                        $this->get('value'), $this->get('value_id'));
         }
 
         return $this->_value;
-- 
GitLab