2

I have a custom component that handles generates a page containing a list of events, and a page giving details for the event. Previously, I would have one menu item setup to handle the list page:

Code: JRoute::_('index.php?Itemid=102&component=com_event&view=events');`            
Result: /index.php?Itemid=102&option=com_event&view=events
SEF: /events

To handle the url for the details of specific events, I would use simply use the following:

Code: JRoute::_('index.php?component=com_event&view=event&id=1');
Result: /index.php?Itemid=102&option=com_event&view=event&id=1
SEF: /events/event/1

Since Joomla 3.8.4:

Code: JRoute::_('index.php?component=com_event&view=event&id=1');
Result: /index.php?option=com_event&view=event&id=1
SEF: /components/com_events/event/1

The Itemid is no long included automatically. This creates an issue with the active check on menu items. Is there a way to fix this outside of editing every single instance of JRoute to manually include Itemid?

1 Answer 1

1

There seems to be a bug with the routing in Joomla 3.8.4 which is a known issue and is currently being discussed on Github, here:

https://github.com/joomla/joomla-cms/issues/19496

I've seem elsewhere that a quick fix (temporarily) is to replace the following file:

libraries/src/Router/SiteRouter.php

with the one from Joomla 3.8.3

There is also a pull request here: https://github.com/joomla/joomla-cms/pull/19498

1
  • Oh, it's good to know this is an actual confirmed bug instead of an intended change. I found a quick dirty work around by forcefully re-adding Itemid in my components router, but I feel like your solution is probably the better/smarter way to handle this.
    – Chaosxmk
    Commented Jan 31, 2018 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.