Support

Akeeba Ticket System

#33398 MyTickets link does not work

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 vnation on Friday, 17 July 2020 05:40 CDT

vnation

Hi,Β 

the MyTickets-links does not work anymore. I'm not sure with which version this started. I just got a report from a user. Both on your and my site. The configuration of the menu item I have attached to this ticket. The generated link on your site is this:Β https://www.akeebabackup.com/support.html

Best wishes
Sven

nicholas
Akeeba Staff
Manager

I can tell you why it didn't work on our site. I was running a pre-3.4.2 dev release on our site which didn't have the fix for the SEF router. I installed 3.4.2 now and the link works.

Please make sure that your My Tickets link is not a submenu of the ATS main menu (ticket categories). If your site is already structured differently you can create a menu item in a hidden menu and replace the old My Tickets link with a System, Alias menu item.

This change is necessary because of the way Joomla 4 component SEF routers work. In fact, this is how Joomla 3.4 and later component SEF routers work, it's just that Joomla 3 still has backwards compatibility with the old SEF routers which use the Joomla 1.6 to 3.3 methodology.

So far we had not updated our SEF router to keep backwards compatibility. However, we reached a point where ATS would be unusable in Joomla 4 if we didn't upgrade our SEF router. The downside of upgrading the router is that some black magic I had done with the one-off views, such as My Tickets and Buckets, would no longer work. I had to modify that code a bit and it was, indeed, very broken in 3.4.0 and 3.4.1. In 3.4.2 I fixed it but you may need to move menu items around to prevent Joomla reporting the wrong (least specific) menu item as more relevant to the router.

Having worked with Joomla's SEF routers I understand why literally nobody else is implementing a routing system with so many degrees of freedom. Everyone else registers what would be a per-component and per-view prefix, regardless of the menu structure visible to the user. In Joomla we're trying to do that PLUS keep coherence between the menu structure and the URL structure. Each method is diametrically opposite to the other and, yet, we're trying to make them work together. Hilarity ensues, for "oh my God I spent five days on this, why is it still doing funky things" values of "hilarious".

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

vnation

Thanks for your prompt response! Of course my menu item was a sub menu item. I changed it to be a menu item alias. I have a hidden "ticket system" menu with four menu items. That should be the correct structure, right? Still, the link is not rendered correctly. I'm sure I miss something.Β 

Β 

nicholas
Akeeba Staff
Manager

Based on your screenshots you are essentially doing what I'm doing on our site and my development sites. Also, what you see is consistent with the broken routing from 3.4.1. I start wondering if Joomla is picking up the wrong SEF router or if we have a caching issue.

Try installing ATS manually, twice, without uninstalling it before or in between. This makes sure that the router.php file will really get overwritten with the new version.

Next, go to System, Clear Cache and clear the frontend cache. This should invalidate any cached links in the menu modules.

If you are using a third party SEF/SEO extension you will need to clear its URL cache for Akeeba Ticket System as well.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

vnation

I installed twice and compared the router.php on the server with the one in the package file: they are identical. We can rule out a problem here. (fingers crossed)

I use only build in SEF options, no additional component is in place. With turned off SEF URLs, the issue persists. The link is still going to the parent menu item. I also modified all other ATS menu items to be aliases. But this leads to the fact that the sub menu disappears since the alias kicks in.Β 

My debugging options are currently limited. I just saw that somewhere the query is changed from an alias to 'Mies' to 'categories'. For now, I fixed that with System -> URL menu item types and I'm using hard-coded URLs.Β 

nicholas
Akeeba Staff
Manager

With turned off SEF URLs, the issue persists. The link is still going to the parent menu item.

Wait, what? This doesn't make any sense. What is the non-SEF URL you get? It should be index.php?option=com_ats&view=Mies&Itemid=YOUR_MENU_ID_HERE.

I just saw that somewhere the query is changed from an alias to 'Mies' to 'categories'.

No, it has not. The "categories" views displays a list of all ATS categories. It's not the My Tickets page. You can't use one instead of the other.

In fact, if you really are manually using view=categories and it shows the My Tickets page I would suspect that something is terribly broken on your site...

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

vnation

I guess my writing was hard to understand. Sorry for that. My menu structure you already know from the screenshots. ID 1555 is the "my-tickets" menu item, 845 is the support menu item and 846 is the "my-tickets"-alias.Β 

In the build method of the router, there are several tries to find a menu item (e.g. Router::findMenu: 468). But then the view 'categories' get set and the menu item 845 is found. The option+view are derived from that menu item. This is then com_ats+categories instead of com_ats+Mies. Not sure is this helps.

Β 

nicholas
Akeeba Staff
Manager

Can you please change line 445 from

$qoptions['view'] = 'MySSS';

to

$qoptions['view'] = 'Mies';

and tell me if that works on your site? Seeing the commit comments in the two changes I made in September 2018 and again in July 2020 I think this must be the problem. Please let me know how that works on your site since I can't reproduce it on my dev or live sites ????

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

vnation

This change helps!

With the hidden menu + hidden menu item + alias it'll now render the correct link. It has the wrong path because it picks up the hierarchy from the hidden menu (categories/my-tickets) so I changed the menu item below the support menu item to an ATS Tickets-Menu item again. The generated link /support/my-tickets) works now as expected. I don't need the hidden menu item anymore.

I heard you're creating an awesome backup solution. This tool I could use to create a test environment if you think that helps. :-)

nicholas
Akeeba Staff
Manager

Thank you so much for the feedback!

I don't need a test environment, I understand now what is going on. The router was looking for view=My which is not how the menu item is created. It should be looking for Mies (the story behind that is long and complicated). In the past the code would fail back to using the current Itemid. That behavior was causing problems with nested categories and I removed it in 3.4. I forgot to change back the My/Mies code to also look for Mies, hence the broken link.

On our site it just so happens that the menu item predated the My/Mies change so the router worked on it with one small change around line 412 so Mies is not missing from the case statement. Of course this wouldn't work on anyone else's site. Thank you for giving me the screenshot with the relevant part of the code that you tracked down. This was the key to understanding the missing bit.

I also see that handling the Buckets view was never added to the router so I need to fix that too. I guess we'll have a late July / early August release to fix these issues.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

vnation

Perfect! I feel your pain with all the routing stuff!

I'll wait for the release and remove my temporary fix with the URL menu items then.Β 

Β 

Thank you!!

nicholas
Akeeba Staff
Manager

Apparently neither Buckets nor Assigned Tickets need special routing. They can only ever be menu items which are routed internally by Joomla itself. Next release will be soon, probably 7-10 days from now.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

vnation

Thanks again! Take your time :) I'll close the ticket.Β 

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!