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.
This commit is contained in:
Charles 2024-05-25 06:04:39 -05:00 committed by GitHub
parent 5b35b2be30
commit fb1e5b9dd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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));