?
avatar richard67
richard67
17 Mar 2015

Possible regression, because did not occur on 3.4.0

Steps to reproduce the issue

On a clean multilingual 3.4.0 installation upgraded to 3.4.1-rc, go to the home page and switch to some other language than the one you initially get.

Close the browser tab, open a new one and enter in address bar the site root and press enter.

Expected result

You get to the home page with a redirect based on the previously selected language remembered with help of the cookie, but not PHP message in between.

Actual result

I got redirected in the correct way, but for a short moment a browser page with a PHP warning text and blank background was shown.

I had to stop loading before the redirect occurred to have a chance to see following PHP message:

Notice: Undefined variable: lang_code in plugins/system/languagefilter/languagefilter.php on line 297

(The root part of the URL I stripped off).

Because I do not really dare to figure out if the correct change of

$lang = $uri->getVar('lang', $lang_code);

would be just

$lang = $uri->getVar('lang');

or maybe better

$lang = $uri->getVar('lang', $this->default_lang);

or maybe more complicated, after all the discussions and multiple PRs from many people, I do not make a PR myself but prefer someone to have a look on it, e.g. @Hackwar

System information (as much as possible)

Clean multilingual 3.4.0 installation upgraded to 3.4.1-rc in a folder protected with .htaccess authentication, SEF URLs = ON, URL rewriting = ON or OFF, does not matter, all the rest regarding SEF and also the remove default language setting of the languagefilter = OFF.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar richard67 richard67 - open - 17 Mar 2015
avatar richard67 richard67 - change - 17 Mar 2015
Labels Removed: ?
avatar richard67 richard67 - change - 17 Mar 2015
Title
Undefined variable lang_code in plugins/system/languagefilter/languagefilter.php on line 297
3.4.1-rc Undefined variable lang_code in plugins/system/languagefilter/languagefilter.php on line 297
avatar richard67 richard67 - change - 17 Mar 2015
The description was changed
avatar richard67
richard67 - comment - 17 Mar 2015

We have a PR #6483 , thanks @Hackwar . Have just tested with success.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6481.
avatar zero-24 zero-24 - close - 17 Mar 2015
avatar richard67
richard67 - comment - 17 Mar 2015

Closing since we have PR, see comment above.

avatar richard67 richard67 - change - 17 Mar 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-03-17 22:46:21
avatar richard67 richard67 - close - 17 Mar 2015
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment