Skip to content
Snippets Groups Projects
Commit 8c8cd1fa authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #3272 from greezybacon/issue/3029

thread: Fix crash processing problem attachments
parents 3393aa98 29c4cba0
No related branches found
No related tags found
No related merge requests found
......@@ -914,9 +914,18 @@ implements TemplateVariable {
_S($error_descriptions[$error]));
}
// No need to log the missing-file error number
if ($error != UPLOAD_ERR_NO_FILE)
$this->getThread()->getObject()->logNote(
_S('File Import Error'), $error, _S('SYSTEM'), false);
if ($error != UPLOAD_ERR_NO_FILE
&& ($thread = $this->getThread())
) {
// Log to the thread directly, since alerts should be
// suppressed and this is defintely a system message
$thread->addNote(array(
'title' => _S('File Import Error'),
'note' => new TextThreadEntryBody($error),
'poster' => 'SYSTEM',
'staffId' => 0,
));
}
continue;
}
......@@ -2458,7 +2467,7 @@ implements TemplateVariable {
));
}
function addNote($vars, &$errors) {
function addNote($vars, &$errors=array()) {
//Add ticket Id.
$vars['threadId'] = $this->getId();
......
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