Routing of our component broke in Joomla 4. #35621
Replies: 2 comments 9 replies
-
I can only guess that it happens because in Joomla 3, if you do not pass Itemid in the URL of Router::_ call, Joomla will use pass current active menu item to the URI object for building SEF url. However, in Joomla 4, for some reasons, that logic is not used anymore. The method |
Beta Was this translation helpful? Give feedback.
-
You have to find correct Itemid for the link in your router, Maybe can try look in com_content as example of new router. joomla-cms/components/com_content/src/Service/Router.php Lines 100 to 102 in f575a49 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a very big issue since the installation on my local server of Joomla 4. The routing in our component in Joomla 4 broke. This current router.php creates in Joomla 4 this URL:
localhost/component/eventary/?id=688&Itemid=101
But it should create this:
localhost/kurse/688-event-name
where "event-name" is the event name. The event name is grabbed bypublic function getEventAlias($id)
and automatically updates the URL to theslug
table inside the database calledeventary_event
. This router.php worked completely fine in Joomla 3.10.0 but broke in Joomla 4.If I disable the router I get a different URL.
I also read https://docs.joomla.org/J3.x:Supporting_SEF_URLs_in_your_component but I cannot see what could cause the issue in my current router.
my router.php:
Beta Was this translation helpful? Give feedback.
All reactions