Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joomla 3.8x MenuRules ignores layout attribute - Bugfix included #19515

Closed
RubbelDeCatc opened this issue Feb 1, 2018 · 3 comments
Closed

Joomla 3.8x MenuRules ignores layout attribute - Bugfix included #19515

RubbelDeCatc opened this issue Feb 1, 2018 · 3 comments

Comments

@RubbelDeCatc
Copy link

RubbelDeCatc commented Feb 1, 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;
@ghost
Copy link

ghost commented Feb 1, 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?

@joomla-cms-bot
Copy link

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

@Quy
Copy link
Contributor

Quy commented Feb 1, 2018

See PR #19516


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants