J3 Issue ?
avatar Giuse69
Giuse69
8 Oct 2018

Steps to reproduce the issue

A two languages site EN and IT an article created in the two languages and associated each other, a menu item pointing to article category created in the two languages and associated each other.
Going to the article in English, language switcher module published, SEF enabled with URL rewrite.

Expected result

The IT flag link points to the Italian article.
The EN flag (current language) points to current URL.

Actual result

Current language flag points to the menu URL, without the last part of the article.

System information (as much as possible)

Joomla 3.8.12, no additional component nor plugin.

Additional comments

avatar Giuse69 Giuse69 - open - 8 Oct 2018
avatar joomla-cms-bot joomla-cms-bot - change - 8 Oct 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Oct 2018
avatar infograf768
infograf768 - comment - 9 Oct 2018

Can't reproduce here. Code implies that an associated item (here an article) has priority over a menu item.

avatar Giuse69
Giuse69 - comment - 9 Oct 2018

See for example here: article in English, the Italian flag points to the Italian associated article, the English flag points to menu URL and not to current article. Same for Italian article: English flag link is ok, Italian flag not ok.
Probably because there is no associated English article to current article but... since it is the article itself?

avatar infograf768
infograf768 - comment - 9 Oct 2018

what are the settings of this site? They look pretty weird.
I see homes do not display anything and there are no menu modules with links.

domain.info/OTHER/j4/
domain.info/OTHER/j4/it/

This does not look like a joomla issue. You should use the forums to try to solve your problem.

avatar brianteeman brianteeman - change - 9 Oct 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 9 Oct 2018
avatar Giuse69
Giuse69 - comment - 9 Oct 2018

I put up this very simple scenario/site just for showing this issue (it is an almost empty site in a subfolder of an exiting site) but you can see the same issue in the main site, for example here

avatar infograf768
infograf768 - comment - 9 Oct 2018

I confirm.
Is it a real issue? Not really as it is useless to click on the flag for the same language.
This is why we may set the Active Language parameter to No in the module when not using dropdown.
Nevertheless we should try to solve that.

avatar brianteeman
brianteeman - comment - 9 Oct 2018

Make the flag for the active language inactive?

avatar infograf768
infograf768 - comment - 9 Oct 2018

We could do that, but I am looking at another possibility right now.

avatar brianteeman
brianteeman - comment - 9 Oct 2018

Semantically it probably should be disabled/inactive

avatar infograf768
infograf768 - comment - 9 Oct 2018

Displaying the flag or language name without a link would look pretty weird.
Users may think something is wrong when they click on it.
I prepared a PR which will correct the issue and display the current url.

avatar brianteeman
brianteeman - comment - 9 Oct 2018

Just as a "home" link shouldnt be enabled on the home page

avatar infograf768
infograf768 - comment - 9 Oct 2018

Not related at all.
The home link IS enabled. The only difference is that it does not need associations to be associated.
The link in that case is simply
$language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $itemid);

avatar infograf768 infograf768 - change - 9 Oct 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-10-09 10:22:26
Closed_By infograf768
avatar infograf768
infograf768 - comment - 9 Oct 2018

Closing as we have a patch
#22558

@Giuse69
I can add the full modified file there if you can't apply patches.

avatar infograf768 infograf768 - close - 9 Oct 2018

Add a Comment

Login with GitHub to post a comment