No Code Attached Yet
avatar Ddcdom
Ddcdom
22 Jul 2020

Steps to reproduce the issue

  1. Create a component view with two layouts, one default.
  2. Create a menu item for each layout.
  3. In the component router register the view.
  4. Use JRoute::_ to render a route to the default layout.

Expected result

For JRoute::_ to return the URL for the menu item associated with the default layout.

Actual result

JRoute::_ returns the menu item for the non default layout.

System information (as much as possible)

Fresh install of Joomla 3.9.20

Additional comments

This is caused at lines 256 to 259 in \Joomla\CMS\Component\Router\Rules\MenuRules::buildLookup.

If a menu item id is set for is set for the default layout of a view, then its menu item id will be overwritten by any other layout from that view.

avatar Ddcdom Ddcdom - open - 22 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 22 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Jul 2020
avatar Ddcdom Ddcdom - edited - 23 Jul 2020
avatar Ddcdom Ddcdom - change - 23 Jul 2020
Title
Component routers gives incorrect menu item for default view layouts when view has non default layouts
[3.9] Component routers gives incorrect menu item for default view layouts when view has non default layouts
avatar brianteeman
brianteeman - comment - 28 Aug 2022

Thank you for raising this issue.

Joomla 3 is now in security only mode with no further bug fixes or new features.

As this issue doesn't relate to Joomla 4 it will now been closed.

If we are mistaken and this does apply to Joomla 4 please open a new issue (and reference this one if you wish) with updated details for testing in Joomla 4.
cc @zero-24

avatar alikon alikon - change - 28 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-28 07:45:26
Closed_By alikon
Labels Added: No Code Attached Yet
Removed: ?
avatar alikon alikon - close - 28 Aug 2022

Add a Comment

Login with GitHub to post a comment