Support

Akeeba Ticket System

#27412 Bad link in emails sent through CLI

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Ticket System version
n/a

Latest post by weeblr on Friday, 24 March 2017 03:21 CDT

weeblr
 HI

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

tampe125
Akeeba Staff
Hello Yannick,

your fix should do the work. In the meantime we are working on a better and more generic solution as the problem seems to be elsewhere.

Thank you again for your report!

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

weeblr
Hi

Ah ok, the issue seemed rather straightforward though, siteURL was added twice if $isCLI is true.

Anyway, it's fixed for me.

Rgds

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!