From fb1e5b9dd5726a85a107d78e188e6a1b554bc609 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 25 May 2024 06:04:39 -0500 Subject: [PATCH] Update card.php Issue #29757 (#29758) Bug-Fix Issue #29757 Prevent the check for a duplicate ref from populating the new ticket object fields with values from the conflicting ticket. --- htdocs/ticket/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 82d1bab2c07..265a661448d 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -212,7 +212,8 @@ if (empty($reshook)) { $db->begin(); $getRef = GETPOST("ref", 'alphanohtml'); - if ($object->fetch('', $getRef) > 0) { + $refcheck_object = new Ticket($db); + if ($refcheck_object->fetch('', $getRef) > 0) { $object->ref = $object->getDefaultRef(); $object->track_id = null; setEventMessage($langs->trans('TicketRefAlreadyUsed', $getRef, $object->ref));