?
avatar ced1870
ced1870
13 Apr 2018

Steps to reproduce the issue

In a multilanguage website, create a system plugin with just that :

public function __construct(&$subject, $config = array()) {
	$doc = JFactory::getDocument();

	parent::__construct($subject, $config);
}

Expected result

Nothing

Actual result

the lang html attribute does not update to the current language, still remains on the default language

instead of (for a french based website) when switching on the english language

System information (as much as possible)

PHP Version 7.1.8
Database Version 5.7.9
Joomla! 3.8.6

Additional comments

avatar ced1870 ced1870 - open - 13 Apr 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Apr 2018
avatar infograf768
infograf768 - comment - 13 Apr 2018

question: can you reproduce this when multiple languages are installed, multilingual is not implemented, but some registered users have chosen another site UI language than the default site one?

avatar ced1870
ced1870 - comment - 13 Apr 2018

if I force the language in the user account, it works

avatar infograf768
infograf768 - comment - 13 Apr 2018

therefore, you mean Even when the site is NOT a full multilingual site ? (In the sense of using the language filter system plugin and switcher module)

avatar Bakual
Bakual - comment - 13 Apr 2018

You shouldn't fetch the document in the plugin constructor. That's the issue. With that, you force a document creation prior to when the CMS actually would do it.
That is because the (system) plugin classes actually get loaded very early in the request cycle.

Move that code to the plugin event where you actually use it, and then it will work fine.

avatar ced1870
ced1870 - comment - 13 Apr 2018

yes, tested both with plugin/module activated or not, the html tag is ok when user loggied in with specific language in the profile

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Apr 2018

@ced1870 if this issue is solved, please close, thanks.

avatar ced1870 ced1870 - close - 13 Apr 2018
avatar ced1870 ced1870 - change - 13 Apr 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-04-13 11:58:35
Closed_By ced1870

Add a Comment

Login with GitHub to post a comment