#32097 – Invalid URL used when setting ticket status, missing

Posted in ‘Akeeba Ticket System’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Thursday, 05 December 2019 12:06 CST
weeblr
Hi

When a support staff tries to set a ticket status using the top right corner drop down - in front end, this does not work as the javascript is not using the correct URL. The prefix ATS_ROOT_URL is missing in that case, while it's correctly used in all othrt javascript instance use of $.ajax I found.

I found 3 instances of this:

media/com_ats/js/adm_tickets.js: looks like admin, should work fine

media/com_ats/js/ticket.js, at line 61 and 70, those are the breaking ones.

Best regards

Custom Fields

Joomla! version (in x.y.z format) 3.9.13
PHP version (in x.y.z format) 7.3.12
Akeeba Ticket System version (x.y.z format) 3.0.4
Thursday, 05 December 2019 12:13 CST
weeblr
Hi again


let me correct that: the file list is wrong, it should be

media/com_ats/js/ticket.js, at line 70
media/com_ats/js/tickets.js at line 61

Note that in ticket.js, I also suspect the other ajax call (to assign the ticket) is also probably missing the root url)

Fixing those lines with

 $.ajax( ATS_ROOT_URL + 'index.php?option=com_ats&view=Tickets&task=ajax_set_status&format=json&'+$('#token').attr('name')+'=1',{

instead of
 $.ajax( 'index.php?option=com_ats&view=Tickets&task=ajax_set_status&format=json&'+$('#token').attr('name')+'=1',{


Fixes the problem.

Best regards
Thursday, 05 December 2019 12:16 CST
weeblr
Hi again

Found another instance in media/com_ats/js/timecards.js

Best regards

Friday, 06 December 2019 03:24 CST
tampe125
Hello,

can you please give more details about this issue?
I ran some tests, but I wasn't able to replicate it locally. In which page does it happen? In Admin Tools you can change those values in several different places (Tickets list, single ticket, Latest opened tickets etc etc).

By the way, do you have SEF URLs enabled in your site? If so, are you using the .htaccess rewrite rules or not?


Davide Tampellini

Developer and Support Staff



Italian: native

English: good



Please keep in mind my timezone and cultural differences when reading my replies. Thank you!



Friday, 06 December 2019 07:44 CST
weeblr
Hi Davide,

Yes, this is with SEF and .htaccess (and sh404SEF).

As you are using a relative URL, the ajax request is posting its data to, for instance,

https://example.com/helpdesk/latest/index.php?option=com_ats&.....

instead of

https://example.com/index.php?option=com_ats&.....

Relative URLs are ok in the backend but on front end they'll cause this kind of issue. ATS does use a properl absolute URL in all instances (and has the ATS_ROOT_URL defined for that) but not in the 3 instances I identified where this was overlooked.

Best regards
Friday, 06 December 2019 08:14 CST
weeblr
Hi

I realize now that this may not occur if you are with Apache and AcceptPathInfo is enabled, maybe that's the reason?

Best regards
Monday, 09 December 2019 09:57 CST
tampe125
Thank you very much for the report, there was a bug indeed.
Can you please download the latest dev release and try again?


Davide Tampellini

Developer and Support Staff



Italian: native

English: good



Please keep in mind my timezone and cultural differences when reading my replies. Thank you!



Monday, 09 December 2019 12:24 CST
weeblr
Hi Davide,

Thanks, that fixes this particular problem!

Actually, as I installed this dev package, I noticed something a bit peculiar: you do include an sh404SEF plugin for ATS, which I appreciate. When installing the ATS package, the sh404SEF plugin is correctly installed in the /plugins/sh404sefextplugins folder however another copy of the plugin is also found in the /plugins/com/ats folder!

I deleted that folder and installed again the package to be sure but yes, it does that.

Best regards
Tuesday, 10 December 2019 05:20 CST
tampe125
Thank you very much for the report.
Yes, it's strange, the plugin ends up in that folder, too.

I'll investigate on this, in the meantime you can safely ignore this, since it's harmless (even if annoying)


Davide Tampellini

Developer and Support Staff



Italian: native

English: good



Please keep in mind my timezone and cultural differences when reading my replies. Thank you!



Thursday, 09 January 2020 17:17 CST
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.

Support Information

Working hours: Typically we work Monday to Friday, 9am to 7pm Cyprus timezone (EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets, but we cannot respond to them, outside of our working hours.

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!