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

Gantry5.5 Joomla: Gantry\Framework\Menu - Differences with Joomla mod_menu Helper #2935

Closed
joomlabeat opened this issue Nov 8, 2021 · 4 comments
Assignees
Milestone

Comments

@joomlabeat
Copy link

joomlabeat commented Nov 8, 2021

Hello,
after upgrading to 5.5, one of my menu items of a custom component (that is not providing a router), it doesn't produce a clean SEF URL, based on the alias of the menu item, but it also appends various query parameters based on the options set on the menu item.

After researching, I ended up checking the Gantry\Framework\Menu and comparing it to the mod_menu Helper.

There is some difference between Gantry and Joomla mod_menu for the menu items.
In Joomla, when there is a menu item - Joomla transforms the menu item link to something like:
$link = 'index.php?Itemid=' . $menuItem->id;

Then, later on it produces the SEF URL with JRoute::_($link);

Gantry on the other hand, inside the createMenuItem() just uses the link of the menu item like so: $link = $menuItem->link; and that's what it sends to the JRoute...

So, this in general produces an inconsistency on how a Joomla menu item SEF URL will be generated when using a core Joomla module or Gantry Menu.

I didn't check any < 5.4 versions of Gantry... but in Gantry\Framework\Menu::createMenuItem() it mentions that it has been copied from Joomla 3.4 and that "We should keep the contents of the function similar to Joomla in order to review it against any changes."

So, I am not sure how this works in Gantry 5.4 or earlier - and if there have been any changes there ... also I don't know if there are any changes and when in Joomla menu module.

But in this particular site, that specific menu item starts to produce a not very nice SEF URL, right after updating to Gantry5.5

@mahagr
Copy link
Member

mahagr commented Nov 9, 2021

@joomlabeat Please test it now. I updated the SEF logic to match 3.10/4.0.

@joomlabeat
Copy link
Author

@mahagr
I didn't have the time to test it... Most likely during the weekend or on Monday.
By the way, I just noticed this #2938... is it related with this one?

@mahagr
Copy link
Member

mahagr commented Nov 15, 2021

I haven't yet looked into the other issue.

@mahagr
Copy link
Member

mahagr commented Nov 15, 2021

The other issue seems to be different and affects only the routes without a menu item.

@mahagr mahagr closed this as completed Nov 22, 2021
@mahagr mahagr added this to the 5.5.5 milestone Nov 22, 2021
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

2 participants