No Code Attached Yet
avatar Flowman
Flowman
23 Mar 2021

Steps to reproduce the issue

Setup a SEF site.
Create 2 menu items in this order.

  • Sign in | index.php?option=com_users&view=login
  • Sign out | index.php?option=com_users&view=login&layout=logout&task=user.menulogout

When trying to use an URL with access permission to sign in to the page http://test.com/en/administration/ user will be redirected to the Sign out page instead of the Sign in page.

It is because the MenuRules buildLookup will overwrite the first view it finds even when it should only append the view+layout.

Expected result

Redirect user to the Sing in page.

Actual result

User gets redirected to the Sign out page.

System information (as much as possible)

Joomla 3.9.25
PHP Version | 7.3.2

Additional comments

This line is the issue

$this->lookup[$language][$view] = $item->id;
commenting it out will solve this problem but don't know what other implications it has.

Example buildLookup with the line:
/usr/share/nginx/html/libraries/src/Component/Router/Rules/MenuRules.php:265:
array (size=2)
'en-GB' =>
array (size=2)
'login' => string '142' (length=3)
'login:logout' => string '142' (length=3)

Example buildLookup without the line:
/usr/share/nginx/html/libraries/src/Component/Router/Rules/MenuRules.php:265:
array (size=2)
'en-GB' =>
array (size=2)
'login' => string '118' (length=3)
'login:logout' => string '142' (length=3)

avatar Flowman Flowman - open - 23 Mar 2021
avatar joomla-cms-bot joomla-cms-bot - change - 23 Mar 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Mar 2021
avatar Flowman
Flowman - comment - 23 Mar 2021

Forgot to say if you change the menu order it works fine, but in this case I need to have the menus in this specific order and it should still work.

avatar brianteeman
brianteeman - comment - 26 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 Quy Quy - change - 26 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-26 22:55:05
Closed_By Quy
Labels Added: No Code Attached Yet
Removed: ?
avatar Quy Quy - close - 26 Aug 2022

Add a Comment

Login with GitHub to post a comment