J4 Issue ?
avatar joeforjoomla
joeforjoomla
4 Mar 2018

Steps to reproduce the issue

Trying to manage the Itemid inside a generic component router is no more possible. Indeed the buildSefRoute function of the SiteRouter has been modified so that the menu item is instantiated BEFORE the component router is executed, instead of AFTER has always been.

Expected result

Routing system still works for extensions managing the Itemid inside the component router 'build' method and extending the RouterBase class

Actual result

Menu alias is no more resolved being the component router executed AFTER the buildSefRoute get an instance of the current menu based on the current $query['Itemid']

Links are no more:
www.mysite.com/menualias/element

but:
www.mysite.com/component/mycomponent/element?Itemid=1111

System information (as much as possible)

Joomla 4.0

Additional comments

avatar joeforjoomla joeforjoomla - open - 4 Mar 2018
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Mar 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2018
Category Router / SEF
avatar Hackwar
Hackwar - comment - 5 Mar 2018

That is not a regression. First of all, Joomla 4.0 does allow breaks in backwards compatibility. Second of all, you are supposed to modify the Itemid of your component in the preprocess method of your router. Simply said, the explanation of @csthomas is right here (In #18924)

avatar joeforjoomla
joeforjoomla - comment - 5 Mar 2018

Yes @Hackwar you are right. Indeed this is what i did.
But there should not be a sort of documentation about the new preprocess method?
As an extension developer should i guess what's changing in J4? Why nobody says nothing?

avatar infograf768
infograf768 - comment - 5 Mar 2018

Why nobody says nothing?

I guess because nothing is written in stone.

avatar Hackwar
Hackwar - comment - 5 Mar 2018

Considering that the preprocess method has been a part of Joomla since 3.3, it isn't exactly new... And as @infograf768 wrote, 4.0 has not been released yet, so I wouldn't call it a big problem that the docs are not complete yet.

avatar franz-wohlkoenig franz-wohlkoenig - change - 10 Mar 2018
Status New Discussion
avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar wilsonge wilsonge - change - 18 Aug 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-08-18 18:54:50
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 18 Aug 2018

I've added a docs required tag to the original PR (i'm slowly working by way through all those tags and puttings them into the J4 upgrade docs/relevant other docs). Closing this issue as a result

avatar wilsonge wilsonge - close - 18 Aug 2018

Add a Comment

Login with GitHub to post a comment