diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 92863db2fd331d0b5cbb5b239e6b9a8555ea219d..55020e192d99bdaa255917b6bdfde1d2f1cb402d 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -567,6 +567,10 @@ class DynamicFormEntryAnswer extends VerySimpleModel { return $this->getField()->toString($this->getValue()); } + function asVar() { + return $this->toString(); + } + function __toString() { return $this->toString(); } diff --git a/include/class.ticket.php b/include/class.ticket.php index eab0ead26972cf5176b6ac9b05dd6664e4aeff47..3a5a639496169d08da85c7f7a0e409a83d47a919 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -221,7 +221,7 @@ class Ticket { } function getSubject() { - return $this->_answers['subject']; + return (string) $this->_answers['subject']; } /* Help topic title - NOT object -> $topic */ @@ -1098,7 +1098,7 @@ class Ticket { // The answer object is retrieved here which will // automatically invoke the toString() method when the // answer is coerced into text - return $this->_answers[$tag]; + return (string)$this->_answers[$tag]; } return false; @@ -2049,6 +2049,7 @@ class Ticket { // Save the (common) dynamic form $form->setTicketId($id); $form->save(); + $ticket->loadDynamicData(); $dept = $ticket->getDept();