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

[bug] incorrect user action url paths appear in multilanguage #13142

Closed
ioweb-gr opened this issue Dec 9, 2016 · 10 comments
Closed

[bug] incorrect user action url paths appear in multilanguage #13142

ioweb-gr opened this issue Dec 9, 2016 · 10 comments

Comments

@ioweb-gr
Copy link

ioweb-gr commented Dec 9, 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.

@infograf768
Copy link
Member

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

@infograf768
Copy link
Member

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

@mbabker
Copy link
Contributor

mbabker commented Dec 9, 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.

@infograf768
Copy link
Member

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.

@infograf768
Copy link
Member

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.

@ioweb-gr
Copy link
Author

ioweb-gr commented Dec 9, 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.

@infograf768
Copy link
Member

Please test this patch
#13152

@ioweb-gr
Copy link
Author

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.

@joomla-cms-bot
Copy link

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

@infograf768
Copy link
Member

infograf768 commented Dec 10, 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.

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

4 participants