Login redirect problem on multi-language site

General questions regarding the use of languages in Joomla! 2.5.

Moderators: infograf768, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
lte
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 02, 2011 8:22 pm

Login redirect problem on multi-language site

Post by lte » Wed Nov 02, 2011 9:54 pm

I have a test site running with two languages. Language selector and other features are working just fine, but the login redirect doesn't work as expected. When the redirect url is pointing to menu item where access level is registered, the redirect fails. Redirect to public menu item goes fine.

Redirect fails in two different ways depending on the SEF setting. When SEF is off, the redirect loses the 'Itemid' parameter, so it goes the the correct page but is lacking all the definitions attached to that menu item. When SEF is on, redirect loses the alias and goes nowhere. Language is right in both cases.

Am I missing something with the multi-language setup? ???

I did some tracing and I found out that the "magic" happens in languagefilter plugin inside buildRule function. The menu item is being fetched from the menu object, but object doesn't contain that item since user doesn't have access to it.

Code: Select all

if ($item = JFactory::getApplication()->getMenu()->getItem($Itemid))
{
	if ($item->home && $uri->getVar('option')!='com_search')
	{
		$link = $item->link;
		$parts = JString::parse_url($link);
		if (isset ($parts['query']) && strpos($parts['query'], '&')) {
			$parts['query'] = str_replace('&', '&', $parts['query']);
		}
		parse_str($parts['query'], $vars);
		// test if the url contains same vars as in menu link
		$test = true;
		foreach ($vars as $key=>$value)
		{
			if ($uri->hasVar($key) && $uri->getVar($key) != $value)
			{
				$test = false;
				break;
			}
		}
		if ($test) {
			foreach ($vars as $key=>$value)
			{
				$uri->delVar($key);
			}
			$uri->delVar('Itemid');
		}
	}
}
else
{
	$uri->delVar('Itemid');
}

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Thu Nov 03, 2011 6:42 am

I can't reproduce the issue.

Testing with the following settings:
1. One login module per Content Language
2. Redirect in each module is to a menu item tagged to the same language, displayed by a menu module also tagged to the same language.
3. User logging has default frontend language same as the Content Language above.
4 Language filter plugin set to "Automatic Language Change"

Can you play with these parameters?
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

lte
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 02, 2011 8:22 pm

Re: Login redirect problem on multi-language site

Post by lte » Thu Nov 03, 2011 7:32 am

infograf768 wrote:1. One login module per Content Language
2. Redirect in each module is to a menu item tagged to the same language, displayed by a menu module also tagged to the same language.
3. User logging has default frontend language same as the Content Language above.
Same setup

Everything works like a charm when the redirect url is pointing to item with access level "public". When url is pointing to item with access level "registered", it acts like I described in my first post.
infograf768 wrote:4 Language filter plugin set to "Automatic Language Change"
This didn't make any difference, although it does some tricky stuff when you change the language before login.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Thu Nov 03, 2011 8:17 am

No idea why this happens to you.
I have tested here also with the menu module containing the registered menu item set to registered and it worked Ok.

What are the permissions for the user logging?
Here I tested with SuperUser (Joomla 1.7.2)
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

lte
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 02, 2011 8:22 pm

Re: Login redirect problem on multi-language site

Post by lte » Thu Nov 03, 2011 9:03 am

infograf768 wrote:What are the permissions for the user logging?
Here I tested with SuperUser (Joomla 1.7.2)
I tried with SuperUser and registered user on 1.7.2, same result with both. I will keep on testing.

lte
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 02, 2011 8:22 pm

Re: Login redirect problem on multi-language site

Post by lte » Thu Nov 03, 2011 9:57 am

lte wrote:
infograf768 wrote:What are the permissions for the user logging?
Here I tested with SuperUser (Joomla 1.7.2)
I tried with SuperUser and registered user on 1.7.2, same result with both. I will keep on testing.
I did clean install of 1.7.2 and followed the multilang_tutorial to set up two languages. Same problem.

Infograf768, did you have SEF on when you tested? Without SEF it will redirect me to the right page but the Itemid is missing. With SEF it redirects me to front page.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Thu Nov 03, 2011 10:23 am

I tested both with sef on and not

SEF off, the redirect is:

Code: Select all

http://localhost:8888/multifr/index.php?option=com_content&view=category&id=11&Itemid=121&lang=fr
SEF on

Code: Select all

http://localhost:8888/multifr/fr/instructions-multilangue
So it's OK.

Just thinking of something: do you have also a menu item displaying login form?
If yes, the settings may contradict with the module.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

lte
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 02, 2011 8:22 pm

Re: Login redirect problem on multi-language site

Post by lte » Thu Nov 03, 2011 11:23 am

infograf768 wrote:Just thinking of something: do you have also a menu item displaying login form?
If yes, the settings may contradict with the module.
Nope, just the login modules for both languages.

Installation is lying on a public server so I can give you access there is you have time to check it. PM me if interested, thank you!

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Thu Nov 03, 2011 11:39 am

You can send me super user name/pass by pm or mail.
Will look asap, but this may be only next week
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Fri Nov 04, 2011 8:33 am

Conclusion;
I was testing with latest Revision.
Indeed the issue is present in 1.7.2 and is solved in the 1.7.3 to come.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

sscheidegger
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Jan 16, 2012 10:52 am

Re: Login redirect problem on multi-language site

Post by sscheidegger » Mon Jan 16, 2012 12:40 pm

I'm having a minor issue with J1.7.3 on a multi-language site:

My site has standard language German and second language Englsih. There is a login menu item which shows the user profile or the login form when not logged in.
If I log in with language German, everything works well, I am redirected to index.php/de/anmelden/profile. But when I log in with the language set to English, I'm redirected to index.php/de/login/profile. Redirection to German happens because the users preferred language is German (standard). The profile page shows correctly, but the login menut items is not associated with this address. Therefore, some modules (most of the menus) are not shown anymore.

Any ideas how to prevent this behaviour?

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Mon Jan 16, 2012 3:11 pm

This has been corrected in core (for 2.5)
See http://joomlacode.org/gf/project/joomla ... m_id=27118
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

dreherman
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Mar 16, 2012 9:19 am
Location: Breda
Contact:

Re: Login redirect problem on multi-language site

Post by dreherman » Fri Mar 16, 2012 9:30 am

Hello,

I'm also having a little problem with the multilingual login. Well actually maybe it's not a problem but it is sure something what I would like to discuss.

I have setup a multilanguage (Dutch and English for now but more will follow) which seems to work very nicely. One thing pops up if a users logs in let us say on the dutch site, but the user has english as setup language for himself the login redirect fails the same happens vice versa english ==> dutch.

This problem can be overcome by letting a user only login on his own language site. But now comes the big trick if some one has default as his selected language in his user account. He has to login on the dutch page. So does this mean that I have to let user select his language by creating his account or is this some sort of bug OR am I doing something wrong <=== sure hope so to be honest.

Hope some of you experts can help me out with this.

Regards,

Dennis

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Sat Mar 17, 2012 6:08 am

We have changed some of this behaviour for 2.5.4 to come:
See http://joomlacode.org/gf/project/joomla ... m_id=27959
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

arakic5
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Nov 28, 2012 6:59 pm

Re: Login redirect problem on multi-language site

Post by arakic5 » Wed Nov 28, 2012 7:22 pm

Hello all,

Answer: go to Plugins >>System - Language Filter >>Automatic Language Change set to NO. thats it.
You do not have the required permissions to view the files attached to this post.

User avatar
RustyJoomla
Joomla! Explorer
Joomla! Explorer
Posts: 395
Joined: Wed Aug 01, 2007 12:08 am
Location: UK
Contact:

Re: Login redirect problem on multi-language site

Post by RustyJoomla » Sat Apr 19, 2014 1:06 am

arakic5 wrote:Hello all,

Answer: go to Plugins >>System - Language Filter >>Automatic Language Change set to NO. thats it.
I was having a similar problem where the redirects weren't working.

But using this fix above, does this bring any other problems with it? As it's no longer Automatically changing the language? OR have I got this wrong?
Follow me on Twitter - http://twitter.com/RustyJoomla
Company Joomla Website - https://storm.agency

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18711
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Login redirect problem on multi-language site

Post by infograf768 » Sun Apr 20, 2014 4:27 pm

What the automatic language change does is to redirect to the user default site language instead of remaining in the same language as logging. Therefore it can't create any issue.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

jorgeflores
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Apr 09, 2014 6:51 pm

Re: Login redirect problem on multi-language site

Post by jorgeflores » Mon Apr 20, 2015 4:44 pm

Hello infograf768!

We are having the same problem with the Login in a multilanguage site (www.ctifranciamexico.com). In the first language (spanish), the login and redirect works fine, but in the second language (french) the redirect is not working and send you to the index.php in spanish (not even in french).

I followed your testing with the following settings... and didn't work. And tried some suggestions in other forum topics before I found this one.

About 1 month ago I was living a nightmare setting the Kunena forum menu in the same multilanguage site and found your solution in a forum topic. It worked pecfectly... so you are the man to follow in Joomla!

I asked the SobiPro developers because I thought it was an item related to the extension, but they answered me:

You probably set something wrong with login redirection, because when I try to login from users login page (outside SobiPro) it behave in same way:
http://www.ctifranciamexico.com/index.p ... =com_users
check how you set login redirection for french version of login module, but in overall it is question for Joomla! forum.

Hope you can help me! Thanks in advance!

Jorge Flores

Bax01
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Oct 16, 2015 12:51 pm

Re: Login redirect problem on multi-language site

Post by Bax01 » Fri Oct 16, 2015 1:08 pm

sorry I did not find a way to delete my post. I moved my post to here since it is Joomla 3.4.4.:

http://forum.joomla.org/viewtopic.php?f=711&t=896295


Locked

Return to “Language - Joomla! 2.5”