?
avatar andrepereiradasilva
andrepereiradasilva
14 Apr 2016

Steps to reproduce the issue

In a multi language site, create a menu structure like this:

Menu fr-FR
- Menu item 1 fr-FR (type Menu Item Alias to Menu item 2 fr-FR)
--- Menu item 2 fr-FR
Menu en-GB
- Menu item 1 en-GB (type Article) - language association to "Menu item 1 fr-FR"

Expected result

If we are in "Menu item 1 en-GB" when we change the language to french we should go to "Menu item 2 fr-FR"

Actual result

Blank page with component not found message ... because it tries to go to "Menu item 1 fr-FR" (/fr/?Itemid=xxxxx)

System information (as much as possible)

Joomla Staging

Additional comments

@infograf768 can you check this one?

I think this may be a Menu alias type problem, ie.e not really related to associations.
If we do a direct access (/fr/?Itemid=xxxxx) to that type of menu we get also the component not found message.

avatar andrepereiradasilva andrepereiradasilva - open - 14 Apr 2016
avatar brianteeman
brianteeman - comment - 14 Apr 2016

Sounds similar to #7334


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

avatar brianteeman brianteeman - change - 14 Apr 2016
Labels Added: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 14 Apr 2016

is similar, but not exactly the same thing

avatar brianteeman
brianteeman - comment - 14 Apr 2016

I wonder if it related

On 14 April 2016 at 19:35, andrepereiradasilva notifications@github.com
wrote:

is similar, but not exactly the same thing


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#9911 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar brianteeman brianteeman - change - 14 Apr 2016
Category Administration Multilanguage
avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Apr 2016

The problem of /?Itemid=xxxxx links not working is because the application is trying to dispatch to render the component and then it can't identify the component because Menu items of alias and external URL don't have a component associated. So we get Component not found.

Here: https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/site.php#L230

And then here https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/site.php#L124-L127

avatar infograf768
infograf768 - comment - 15 Apr 2016

Hmm... I guess we have to disable the associations for
separator,alias,heading,url

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Apr 2016

no i think is not needed.
The thing is Joomla should identify this menutypes and redirect to where it should.

avatar infograf768
infograf768 - comment - 15 Apr 2016

well, when you have a menuitem field (to redirect in login module for example), these are greyed.

avatar infograf768
infograf768 - comment - 15 Apr 2016

I have a very simple patch which will grey them and forbid to choose them when setting associations when ediing a menu.
Will do now.

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Apr 2016

this IMHO is not an associations problem but a routing problem.

avatar infograf768
infograf768 - comment - 15 Apr 2016

@andrepereiradasilva
It will not prevent you from looking at another solution for alias, but definitely url, separator and heading should not be presented in the lists

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Apr 2016

ok

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Apr 2016

I guess for alias menu type something like this would work.

Replacing https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/application/site.php#L230, for this:

// Special case for menu item types without components
$menu = $this->getMenu();
$activeMenu = $menu->getActive();

if (isset($activeMenu->type) && $activeMenu->type == 'alias')
{
    $aliasId = $activeMenu->params->get('aliasoptions', 0, 'int');
    $newMenuItem = $menu->getItem($aliasId);
    $this->redirect(JRoute::_($newMenuItem->link . '&Itemid=' . $aliasId));
}

// Dispatch the application
$this->dispatch();

This way all the /?Itemid=xxxxx menu type alias would redirect automatically to the new URL.

But i don't know if it would have other unintended consequences or even if this is the right way to do it in Joomla.

Of course if the menu item alias point to another menu item alias you would still have problems. A more robust solution would be needed.

avatar infograf768
infograf768 - comment - 15 Apr 2016

here is the patch to test. #9929
Thanks.

avatar brianteeman brianteeman - change - 15 Apr 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-04-15 11:14:44
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 15 Apr 2016

Closed please test #9929


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

avatar brianteeman brianteeman - close - 15 Apr 2016

Add a Comment

Login with GitHub to post a comment