Skip to content
Snippets Groups Projects
Commit 54cd4f4e authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #1365 from greezybacon/issue/1326


forms: If an answer has no saved value, use the field

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents dc151658 e5d61922
No related branches found
No related tags found
No related merge requests found
......@@ -1008,10 +1008,12 @@ class DynamicFormEntryAnswer extends VerySimpleModel {
}
function getValue() {
if (!$this->_value && isset($this->value))
$this->_value = $this->getField()->to_php(
$this->get('value'), $this->get('value_id'));
return $this->_value;
$value = $this->getField()->to_php(
$this->get('value'), $this->get('value_id'));
if (!$value && $this->getEntry()->getSource()) {
return $this->getEntry()->getField(
$this->getField()->get('name'))->getClean();
}
}
function getIdValue() {
......
......@@ -2367,6 +2367,7 @@ class Ticket {
// Create and verify the dynamic form entry for the new ticket
$form = TicketForm::getNewInstance();
$form->setSource($vars);
// If submitting via email, ensure we have a subject and such
foreach ($form->getFields() as $field) {
$fname = $field->get('name');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment