A user reported that some link in the notification email they received was wrong. Namely, the site domain was set twice as in:
https://site.com/https://site.com/index.php?option=com_ats&view=ticket&id=123
I have found that this should happen only on emails sent through Cron, ie the CLI, and is related to the code in plugins/ats/postemail/postemail.php, lines 596 through 629.
At line 596, there is:
if ($isCLI) { $url = rtrim($siteURL, '/') . '/index.php?option=com_ats&view=ticket&id=' . $ticket->ats_ticket_id; }
and at line 624, we have:
if ($isCLI) { $postURL = rtrim($siteURL, '/') . '/' . ltrim($url, '/'); }
so indeed it appears the domain is added twice in the case of CLI usage, in the link to the post.
I have added a fix as follow:
if ($isCLI) { // weeblr //$url = rtrim($siteURL, '/') . '/index.php?option=com_ats&view=ticket&id=' . $ticket->ats_ticket_id; $url = 'index.php?option=com_ats&view=ticket&id=' . $ticket->ats_ticket_id; // weeblr }
but it's actually pretty hard to test, as I don't know how to inject an email record in the email queue, to be sent by cron.
Please confirm the fix is valid? or another solution?
Rgds