Skip to content

Commit

Permalink
Issue: Unlinking From Child Ticket
Browse files Browse the repository at this point in the history
Make sure we account for unlinking within a ticket using an AJAX call.
  • Loading branch information
aydreeihn committed Sep 25, 2019
1 parent a0a58e4 commit c76cb21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion include/ajax.tickets.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/class.ticket.php
Expand Up @@ -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) {
Expand Down

0 comments on commit c76cb21

Please sign in to comment.