From 33455caee0908bcff4885b60db041b93ce380e56 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 18 Apr 2016 19:55:55 -0500 Subject: [PATCH] forms: Fix lag updating the CDATA table This fixes an issue where the CDATA table is updated with the OLD version of an answer after it is updated. That is, after an answer is updated, the CDATA table is also updated to reflect the change; however, the old content of the answer value is used when updating the CDATA value. --- include/class.dynamic_forms.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index c672d92e2..513f014c9 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1413,6 +1413,12 @@ class DynamicFormEntryAnswer extends VerySimpleModel { $this->getField()->db_cleanup(); return true; } + + function save($refetch) { + if ($this->dirty) + unset($this->_value); + return parent::save($refetch); + } } class SelectionField extends FormField { -- GitLab