Skip to content
Snippets Groups Projects
Commit e2002bd2 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix crash in enduser web portal on reply

parent 9f54e677
No related branches found
No related tags found
No related merge requests found
......@@ -1933,11 +1933,13 @@ class ThreadEntryWidget extends Widget {
if (!$config)
$config = $this->field->getConfiguration();
return new FileUploadField(array(
$field = new FileUploadField(array(
'id'=>'attach',
'name'=>'attach:' . $this->field->get('id'),
'configuration'=>$config)
);
$field->setForm($this->field->getForm());
return $field;
}
}
......
......@@ -79,7 +79,7 @@ if($_POST && is_object($ticket) && $ticket->getId()):
'userId' => $thisclient->getId(),
'poster' => (string) $thisclient->getName(),
'message' => $_POST['message']);
$vars['cannedattachments'] = $response_form->getField('attachments')->getClean();
$vars['cannedattachments'] = $attachments->getClean();
if (isset($_POST['draft_id']))
$vars['draft_id'] = $_POST['draft_id'];
......@@ -89,8 +89,8 @@ if($_POST && is_object($ticket) && $ticket->getId()):
// for this staff. Else clean all drafts for the ticket.
Draft::deleteForNamespace('ticket.client.' . $ticket->getId());
// Drop attachments
$response_form->getField('attachments')->reset();
$response_form->setSource(array());
$attachments->reset();
$tform->setSource(array());
} else {
$errors['err']=__('Unable to post the message. Try again');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment