Skip to content
Snippets Groups Projects
Commit 2062950b authored by JediKev's avatar JediKev
Browse files

issue: ticket_link Fatal Error

This addresses an issue where replying to a ticket causes a Fatal Error for
the system. This is due to the `$ticket` object not being set before the
else statement therefore causing the `getId()` function to fail. This breaks
down the if/else statement to make sure the `$ticket` object is in-fact set
before continuing.
parent e5a5287b
No related branches found
No related tags found
No related merge requests found
......@@ -59,19 +59,20 @@ implements EmailContact, ITicketUser, TemplateVariable {
case 'ticket_link':
$qstr = array();
if ($cfg && $cfg->isAuthTokenEnabled()
&& ($ticket=$this->getTicket())
&& !$ticket->getThread()->getNumCollaborators()) {
$qstr['auth'] = $ticket->getAuthToken($this);
return sprintf('%s/view.php?%s',
$cfg->getBaseUrl(),
Http::build_query($qstr, false)
);
}
else {
return sprintf('%s/tickets.php?id=%s',
$cfg->getBaseUrl(),
$ticket->getId()
);
&& ($ticket=$this->getTicket())) {
if (!$ticket->getThread()->getNumCollaborators()) {
$qstr['auth'] = $ticket->getAuthToken($this);
return sprintf('%s/view.php?%s',
$cfg->getBaseUrl(),
Http::build_query($qstr, false)
);
}
else {
return sprintf('%s/tickets.php?id=%s',
$cfg->getBaseUrl(),
$ticket->getId()
);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment