From 1bffab82bb4ce93730835c20aa5412efb164bd32 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Tue, 10 Dec 2013 09:04:47 -0600
Subject: [PATCH] forms: Fix regression editing custom forms data

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

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 4714ac4ba..a52990e5a 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -39,6 +39,7 @@ class DynamicForm extends VerySimpleModel {
 
     var $_form;
     var $_fields;
+    var $_has_data = false;
     var $_dfields;
 
     function getFields($cache=true) {
@@ -83,7 +84,7 @@ class DynamicForm extends VerySimpleModel {
 
     function getForm($source=false) {
         if (!$this->_form || $source) {
-            $fields = $this->getFields(false);
+            $fields = $this->getFields($this->_has_data);
             $this->_form = new Form($fields, $source, array(
                 'title'=>$this->title, 'instructions'=>$this->instructions));
         }
@@ -102,6 +103,7 @@ class DynamicForm extends VerySimpleModel {
     function data($data) {
         if ($data instanceof DynamicFormEntry) {
             $this->_fields = $data->getFields();
+            $this->_has_data = true;
         }
     }
 
-- 
GitLab