No Code Attached Yet
avatar mikajaxxx
mikajaxxx
28 Oct 2021

Steps to reproduce the issue

go extension-> langauges- > content langauges & set site name in ' Custom Site Name '
try retrieve site name for language by:
$app = JFactory::getApplication();
$site_name = $app->get('sitename');
or
$config = JFactory::getConfig();
$site_name = $config->get( 'sitename' );

Expected result

both way render current language site name

Actual result

render default langauge site name

System information (as much as possible)

joomla 4.0.4

Additional comments

avatar mikajaxxx mikajaxxx - open - 28 Oct 2021
avatar mikajaxxx mikajaxxx - change - 28 Oct 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 28 Oct 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Oct 2021
avatar brianteeman
brianteeman - comment - 28 Oct 2021

You must enable the language filter plugin

avatar richard67
richard67 - comment - 28 Oct 2021

@mikajaxxx Please check the previous comment and report back if your issue still persists after you have enabled the language filter plugin. Thanks in advance.

avatar joomdonation joomdonation - close - 29 Oct 2021
avatar joomdonation
joomdonation - comment - 29 Oct 2021

As pointed out by @brianteeman , you need to enable System - Language Filter plugin to have it works. The code which handles this could be found here https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/system/languagefilter/languagefilter.php#L189

Closing this issue as this is not a core issue.

avatar joomdonation joomdonation - change - 29 Oct 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-10-29 04:31:12
Closed_By joomdonation
avatar mikajaxxx
mikajaxxx - comment - 31 Oct 2021

@joomdonation & @brianteeman of course i enabled system - language Filter and System - Language Code before reporting this issue!

avatar brianteeman
brianteeman - comment - 31 Oct 2021

In which case neither of us can replicate the reported problem

avatar brianteeman
brianteeman - comment - 31 Oct 2021

image

image

image

image

image

avatar mikajaxxx
mikajaxxx - comment - 31 Oct 2021

It doesnt work on my website, i done it the same way as you!
jeco

avatar joomdonation
joomdonation - comment - 1 Nov 2021

@mikajaxxx Where do you put your code?

avatar mikajaxxx
mikajaxxx - comment - 1 Nov 2021

@joomdonation at a system plugin

avatar joomdonation
joomdonation - comment - 1 Nov 2021

@mikajaxxx And that's the reason of the issue. If you look at https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/system/languagefilter/languagefilter.php#L189, you will see that the language filter plugin process that data on onAfterRoute event, so if your system plugin code is triggered before that, the data won't be available

Add a Comment

Login with GitHub to post a comment