From 41d0b2d0c340fd6cd10576d14d4fe8ff32db631c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 29 Sep 2022 08:56:34 +0200 Subject: [PATCH] FIX avoid override initial message ($this instead $object) --- htdocs/ticket/class/ticket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5ed375a82dc..eda4c06aa1e 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2756,8 +2756,8 @@ class Ticket extends CommonObject $result = $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames); if ($result) { // update last_msg_sent date - $object->date_last_msg_sent = dol_now(); - $object->update($user); // FIXME this update override the initial message + $this->date_last_msg_sent = dol_now(); + $this->update($user); } } } @@ -2766,7 +2766,7 @@ class Ticket extends CommonObject } // Set status to "answered" if not set yet, but only if internal user - if ($object->fk_statut < 3 && !$user->socid) { + if ($object->status < 3 && !$user->socid) { $object->setStatut(3); } return 1;