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
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.
Issue exist since 3.5 or whenever the router was changed.
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;
Priority | Urgent | ⇒ | Medium |
Status | New | ⇒ | Information Required |
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-02-01 15:34:00 |
Closed_By | ⇒ | joomla-cms-bot |
Closed_By | joomla-cms-bot | ⇒ | Quy |
See PR #19516
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19515
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?