diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 4714ac4ba36cb709dc3273e7985fad9ad6867044..a52990e5ab0152859b1ed1d5651566a9b878e729 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; } }