From 0780eb7d5e115e853556b243c094d7817b969718 Mon Sep 17 00:00:00 2001
From: JediKev <kevin@enhancesoft.com>
Date: Thu, 23 Aug 2018 14:20:00 -0500
Subject: [PATCH] forms: Disabled By Help Topic Users

This addresses issue 4470 where Users creating tickets via Client Portal and
failing to fill out a required field makes disabled fields by Help Topic
appear on the page. When the disabled fields appear they allow Users to
populate and save data that they were not meant to submit.
---
 include/class.dynamic_forms.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 207f7b5c1..c47433fa3 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -155,8 +155,12 @@ class DynamicForm extends VerySimpleModel {
         $inst = DynamicFormEntry::create(
             array('form_id'=>$this->get('id'), 'sort'=>$sort)
         );
+
         if ($data)
             $inst->setSource($data);
+
+        $inst->_fields = $this->_fields ?: null;
+
         return $inst;
     }
 
-- 
GitLab