?
avatar ioweb-gr
ioweb-gr
9 Dec 2016

Steps to reproduce the issue

Install latest stable Joomla version
Setup multilanguage
Create two menu items
image
image

Visiting the Greek URL https://www.domain.com/el/είσοδος-χρηστών I get in HTML source code

<link href="https://www.domain.com/el/είσοδος-χρηστών" rel="alternate" hreflang="el-GR" />
<link href="https://www.domain.com/en/είσοδος-χρηστών" rel="alternate" hreflang="en-GB" />

Visiting the English URL https://www.domain.com/en/login I get in HTML source code

<link href="https://www.domain.com/el/login" rel="alternate" hreflang="el-GR" />
<link href="https://www.domain.com/en/login" rel="alternate" hreflang="en-GB" />

Expected result

In both cases it should yield

<link href="https://www.domain.com/el/είσοδος-χρηστών" rel="alternate" hreflang="el-GR" />
<link href="https://www.domain.com/en/login" rel="alternate" hreflang="en-GB" />

System information (as much as possible)

Tested using Joomla 3.6.4 on Debian 8 and php 5.6.27

Additional comments

I don't know if it helps at all but using xdebug I tried to troubleshoot a bit and I reached file
libraries/cms/router/site.php

near line 496:

		// Build the component route
		$component = preg_replace('/[^A-Z0-9_\.-]/i', '', $query['option']);
		$tmp       = '';
		$itemID    = !empty($query['Itemid']) ? $query['Itemid'] : null;
		$crouter   = $this->getComponentRouter($component);
		$parts     = $crouter->build($query);
		$result    = implode('/', $parts);
		$tmp       = ($result != "") ? $result : '';

Debugging in english language at this point of execution $itemID in my case was 676 which is the Greek menu itemID, however after executing $crouter->build($query) the $query['Itemid'] is changed to 693 which is the english language menu itemID.

Consequently it's using $query['itemId'] to build the path to my knowledge.

Any idea why else this might be happening? Thanks in advance

PS: Same thing happes if I create a menu item for password reset, username reminder, registration etc etc.

avatar ioweb-gr ioweb-gr - open - 9 Dec 2016
avatar joomla-cms-bot joomla-cms-bot - change - 9 Dec 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Dec 2016
avatar brianteeman brianteeman - change - 9 Dec 2016
Category Multilanguage Router / SEF
avatar infograf768
infograf768 - comment - 9 Dec 2016

can you please test on staging and give some more details, like where you place these menu items = which menutype.

avatar infograf768
infograf768 - comment - 9 Dec 2016

Hmm...
Tested on staging and indeed I have the same issue. No need to set the menu items to hidden to see the result.

avatar mbabker
mbabker - comment - 9 Dec 2016

I saw this on the downloads site too when the menu item aliases had the language code in them (i.e. login-fr or login-us) for the login page. I just changed all the aliases to be 'login' for all languages to "fix" it.

avatar infograf768
infograf768 - comment - 9 Dec 2016

Associations work fine and with correct urls as long as we use the switcher.
But the alternate is created in the languagefilter plugin in the onAfterDispatch() method and it chokes on these.

avatar infograf768
infograf768 - comment - 9 Dec 2016

The issue looks indeed related to JRoute() and com_users.
https://github.com/joomla/joomla-cms/blob/staging/plugins/system/languagefilter/languagefilter.php#L777

The content of the JRoute here is totally correct. But once passed through JRoute() we get indeed the wrong url.

avatar ioweb-gr
ioweb-gr - comment - 9 Dec 2016

Hi, yes the menutype / name doesn't matter in this case. I've tried moving them around/ recreating in other menus to see if it had an effect but it seems the issue only occurs to com_users urls. I haven't noticed it in any other menu items I created.

avatar infograf768
infograf768 - comment - 10 Dec 2016

Please test this patch
#13152

avatar ioweb-gr
ioweb-gr - comment - 10 Dec 2016

Hi,

it worked OK in my case and fixed the 404 from rel="alternate" on login. I will try and check if anything else was affected.

avatar infograf768 infograf768 - change - 10 Dec 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-12-10 09:56:44
Closed_By infograf768
avatar joomla-cms-bot joomla-cms-bot - change - 10 Dec 2016
Closed_By infograf768 joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 10 Dec 2016
avatar joomla-cms-bot joomla-cms-bot - close - 10 Dec 2016
avatar infograf768
infograf768 - comment - 10 Dec 2016

Closing as we have a patch.
@ioweb-gr

Tests should be done on a patched staging branch, not on 3.6.4 as we also corrected some login issues in staging
Please add comments and test on
https://issues.joomla.org/tracker/joomla-cms/13152


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

avatar joomla-cms-bot
joomla-cms-bot - comment - 10 Dec 2016

Add a Comment

Login with GitHub to post a comment