?
avatar RubbelDeCatc
RubbelDeCatc
1 Feb 2018

Steps to reproduce the issue

Create two menu entries listing categorise with subcategories.
One is layout print one layout default.
index.php?option=com_content&view=categories&id=9
index.php?option=com_content&view=categories&layout=print&id=9

Actual result

The router picks always the print layout item because
this entry was added last to the menu table.

This problem will afflict every component if
entries with same attributes but different layouts
exist.

System information (as much as possible)

Issue exist since 3.5 or whenever the router was changed.

Solution / Fix

The issue is caused by a unnecessary simplification in
the buildLookup function of MenuRules.php

$this->lookup[$language][$view . $layout][$item->query[$views[$view]->key]] = $item->id;
$this->lookup[$language][$view][$item->query[$views[$view]->key]] = $item->id;

and

$this->lookup[$language][$view . $layout] = $item->id;
$this->lookup[$language][$view] = $item->id;

I don't understand why both keys are set. It is completely unnecessary.
You can safely remove these two lines because $layout is always set.

$this->lookup[$language][$view][$item->query[$views[$view]->key]] = $item->id;

and

$this->lookup[$language][$view] = $item->id;
avatar RubbelDeCatc RubbelDeCatc - open - 1 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Feb 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Feb 2018
Priority Urgent Medium
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 Feb 2018

Can you please look at https://issues.joomla.org/tracker/joomla-cms on Issues labeled "Router / SEF" started by "Opened 2018-01-30" if this is a duplicate Report?

avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Feb 2018
Status New Information Required
avatar joomla-cms-bot joomla-cms-bot - change - 1 Feb 2018
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2018-02-01 15:34:00
Closed_By joomla-cms-bot
avatar Quy Quy - change - 1 Feb 2018
Closed_By joomla-cms-bot Quy
avatar joomla-cms-bot joomla-cms-bot - close - 1 Feb 2018
avatar Quy
Quy - comment - 1 Feb 2018

See PR #19516


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19515.

avatar joomla-cms-bot
joomla-cms-bot - comment - 1 Feb 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19515

Add a Comment

Login with GitHub to post a comment