diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php index 9dac1d8f87..0d7c8e2b41 100644 --- a/include/ajax.tickets.php +++ b/include/ajax.tickets.php @@ -379,7 +379,13 @@ function updateMerge($ticket_id) { $info = array(); $errors = array(); - if ($_POST['tids']) { + if ($_POST['dtids']) { + foreach($_POST['dtids'] as $key => $value) { + if (is_numeric($key) && $ticket = Ticket::lookup($value)) + $ticket->unlink(); + } + return true; + } elseif ($_POST['tids']) { if ($parent = Ticket::merge($_POST)) Http::response(201, 'Successfully managed'); else diff --git a/include/class.ticket.php b/include/class.ticket.php index b2f4940594..951fe503a3 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -2419,7 +2419,7 @@ function unlink() { $child = Ticket::lookup($child[0]); $child->unlinkChild($parent); } - } else + } elseif ($child) $child->unlinkChild($parent); if (count(Ticket::getChildTickets($pid)) == 0) {