|
|||||||
| Attachments Not Emailed When Creating New Ticket | ||||
|---|---|---|---|---|
Category Unknown |
Affected Version 1.6 Stable |
Priority 5 - Medium |
||
Status Unconfirmed |
Fixed Version (none) |
|||
Submitted 08-07-2011 |
||||
|
||||
|
|
|
|
|
|
Attachments Not Emailed When Creating New Ticket
In the staff Create Ticket screen, there is an option to attach a file. The file does properly attach to the ticket, however, the attachment is not included in the email notification that is sent to the user.
I discovered that this was happening because in class.ticket.php, the create_by_staff() method calls the create() method, which calls the uploadAttachment() method, which calls the move_uploaded_file() function, which results in the tmp file being deleted during the ticket creation process. Therefore, when the script tries to email the attachment after the ticket is created, the file is no longer there. I fixed this by moving the attachment handling logic higher up in the script, immediately before the create() method is called and making a copy of the original tmp file. Thus, when move_uploaded_file deletes the original tmp file, we still have another copy of the file to work with, when calling the $email->send() method. Here's the code I came up with: PHP Code:
|
![]() |
| Issue Tools |
|---|
Subscribe to this issue |