From f2f72294525c055f23bfc82d3e7110d36bbd8709 Mon Sep 17 00:00:00 2001 From: Niijimasama <46041914+Niijimasama@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:07:32 +0300 Subject: [PATCH] Update MailboxService.php (In testing) I have had a persistent issue with some emails generating tickets but threads are empty. This causes tickets to be un-assignable and unreadable from the UI (the error in DEV mode materializes as a "createdat" null variable when trying to view a ticket). Going through the code revealed that this exception is not handled. I am not a high level programmer so I am still working on this and testing. Goal is to use existing codebase. --- Services/MailboxService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Services/MailboxService.php b/Services/MailboxService.php index 06d2dc6..8275529 100644 --- a/Services/MailboxService.php +++ b/Services/MailboxService.php @@ -470,6 +470,11 @@ public function processMail($rawEmail) 'ticket' => $ticket->getId(), ], ]; + }else { + // if ticket is not empty but thread is empty by Niijimasama + $mailData['threadType'] = 'create'; + //$mailData['referenceIds'] = $mailData['messageId']; + $thread = $this->container->get('ticket.service')->createThread($ticket, $mailData); } if (in_array($mailData['messageId'], $referenceIds)) {