diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 01979c75815e811ec3dccb55c2507df11d0c71d7..3d73b862d4c5badc0269610e5e58f068f7ec3f9f 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -930,12 +930,16 @@ class DynamicFormEntry extends VerySimpleModel { } } - function save() { + function save($refetch=false) { if (count($this->dirty)) $this->set('updated', new SqlFunction('NOW')); - parent::save(); + if (!parent::save($refetch || count($this->dirty))) + return false; + foreach ($this->getFields() as $field) { - $a = $field->getAnswer(); + if (!($a = $field->getAnswer())) + continue; + if ($this->object_type == 'U' && in_array($field->get('name'), array('name','email'))) continue;