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

fix: Make attachments unique per thread entry instead of the ticket thread

The bug prevented attachments from being sent out if it was previously
attached to the ticket - for example, you could resend a file to end user.
parent 3fb48a84
Branches
Tags
No related merge requests found
......@@ -475,10 +475,10 @@ Class ThreadEntry {
return 0;
// TODO: Add a unique index to TICKET_ATTACHMENT_TABLE (file_id,
// ticket_id), and remove this block
// ref_id), and remove this block
if ($id = db_result(db_query('SELECT attach_id FROM '.TICKET_ATTACHMENT_TABLE
.' WHERE file_id='.db_input($fileId).' AND ticket_id='
.db_input($this->getTicketId()))))
.' WHERE file_id='.db_input($fileId).' AND ref_id='
.db_input($this->getId()))))
return $id;
$sql ='INSERT IGNORE INTO '.TICKET_ATTACHMENT_TABLE.' SET created=NOW() '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment