? Success
Related to # 4483

User tests: Successful: Unsuccessful:

avatar clinchergt
clinchergt
17 Oct 2014

This PR solves the issue at #4483

It fetches the application language tag and ensures it's not empty or null before defaulting to the site's default language.

avatar clinchergt clinchergt - open - 17 Oct 2014
avatar jissues-bot jissues-bot - change - 17 Oct 2014
Labels Added: ?
avatar jissues-bot jissues-bot - change - 17 Oct 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 17 Oct 2014
Category Multilanguage
avatar brianteeman brianteeman - change - 17 Oct 2014
Rel_Number 4483
Relation Type Related to
avatar N6REJ
N6REJ - comment - 17 Oct 2014

Can you please explain how to test

avatar clinchergt
clinchergt - comment - 17 Oct 2014

Steps to test this are the same as in the description of the issue:

  1. create multilingual site
  2. set english as default language, swedish as secondary
  3. create a public menu item in swedish pointing to a registered article in swedish
  4. switch to swedish in the frontend, click the menu item link
  5. login form is shown, log in with valid username

Expected result

User is logged in and the registered article in Swedish appears.

Note: Swedish can of course be substituted by any available langauge. Result should be the same, getting redirected to the site in that language after loggin in.

avatar nicksavov nicksavov - change - 17 Oct 2014
Labels
avatar nicksavov nicksavov - change - 17 Oct 2014
Labels Added: ?
avatar nicksavov
nicksavov - comment - 17 Oct 2014

Thanks Jacobo!

avatar infograf768
infograf768 - comment - 18 Oct 2014

Question: what is the default site language set for the user logging in?

avatar infograf768
infograf768 - comment - 18 Oct 2014

@test
This does not work here:
1. if the user's site language is set to English, then the user is redirected to the en-GB Home page
2. If the user's site language is set to Swedish, then the user is redirected to its Profile in Swedish

avatar joomdonation
joomdonation - comment - 18 Oct 2014

@infograf768 : The propose change only has affect if your account doesn't have a language selected.

Not sure how all of you can have login page displayed. When I tried to access to the menu item, I received the error message and have to use login module to login

U bent niet bevoegd deze pagina te bekijken

After login, I am redirected to expected page. So for me, it seems to work well (I reviewed the code as well)

PS: The propose change code will actually change the value of $lang_code to the language tag of active language of the current page, so I think change the code as suggested below will be shorter:

Original code:

if (empty($lang_code))
{
    $lang_code = self::$default_lang;
}

Modified code:

if (empty($lang_code))
{
    $lang_code = self::$tag;
}
avatar infograf768
infograf768 - comment - 19 Oct 2014

Test conditions:
1. Article 1 set to lang B (not site default) with a Read More and set to registered.
2. Menu Item for single article menu item, loading Article 1 and set to lang B and public access

Clicking on the menu item displays the article with its Intro Text and Read More link asking to login

Even when setting Automatic Change to No in the Languagefilter plugin and user has no lang selected in profile (therefore defaulting to default site language), this does not work here.

avatar clinchergt
clinchergt - comment - 26 Oct 2014

@joomdonation You're right, your code works and is a lot more efficient. Thanks!

@infograf768 Make sure you're using a private or incognito window when testing this PR. It seems there's another bug regarding redirection after logging in/out that may be setting a cookie (which would cause this to fail). I've reported that problem here at issue #4934

avatar brianteeman brianteeman - change - 1 Jan 2015
Labels
avatar brianteeman brianteeman - change - 1 Jan 2015
Labels Removed: ?
avatar clinchergt
clinchergt - comment - 8 May 2015

@infograf768 and @joomdonation: could I get you guys to test this again? I'm trying to get my PRs closed/merged after all this time. Sorry for taking so long to update them.

Thanks!

avatar infograf768
infograf768 - comment - 9 May 2015

We can't test this anymore as there were extensive changes in languagefilter.
I suggest you test again for the issue using staging.

In any case, the present code redirects the user to the site default language if no specific site language is set for the user who logins or the user site language does not exist anymore (When Automatic Change is set to Yes).

Solving the issue by always redirecting to the language in use would kill the Automatic Change functionality.

avatar infograf768 infograf768 - change - 10 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-10 14:36:15
Closed_By infograf768
avatar infograf768
infograf768 - comment - 10 May 2015
avatar infograf768
infograf768 - comment - 10 May 2015

Folks, I am closing this one as it is anyway obsolete and we have a working patch here:
#6915

can be tested also with a single article menu item loading a registered article as #6908 has been merged,


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

avatar joomla-cms-bot joomla-cms-bot - close - 10 May 2015

Add a Comment

Login with GitHub to post a comment