diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index a0177cd3338da149a2a055d34a8493616fa45cf7..942efbaa4c7fffe8d6c81293c2fbb2927c6dc2ab 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) {