From 03540bba95f4b92a70e4b19f7bf1fe352aed5e05 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 1 May 2014 12:07:36 -0500
Subject: [PATCH] forms: Fix field lookup issue in DynamicForm::getField

---
 include/class.dynamic_forms.php | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index a0177cd33..942efbaa4 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -74,10 +74,13 @@ class DynamicForm extends VerySimpleModel {
         return call_user_func_array($delegate, $args);
     }
 
-    function getField($name) {
-        foreach ($this->getFields() as $f)
+    function getField($name, $cache=true) {
+        foreach ($this->getFields($cache) as $f) {
             if (!strcasecmp($f->get('name'), $name))
                 return $f;
+        }
+        if ($cache)
+            return $this->getField($name, false);
     }
 
     function hasField($name) {
-- 
GitLab