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

Merge pull request #1256 from greezybacon/issue/1247


oops: Fix crash creating canned responses

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 9bad1bde e9e214bb
No related branches found
No related tags found
No related merge requests found
......@@ -85,11 +85,11 @@ if($_POST && $thisstaff->canManageCannedResponses()) {
$_REQUEST['a']=null;
//Upload attachments
$keepers = $canned_form->getField('attachments')->getClean();
if ($keepers && ($c=Canned::lookup($id)))
if (($c=Canned::lookup($id)) && $keepers)
$c->attachments->upload($keepers);
// Attach inline attachments from the editor
if (isset($_POST['draft_id'])
if ($c && isset($_POST['draft_id'])
&& ($draft = Draft::lookup($_POST['draft_id'])))
$c->attachments->upload(
$draft->getAttachmentIds($_POST['response']), true);
......
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