J4 Issue ?
avatar infograf768
infograf768
6 Jun 2019

Steps to reproduce the issue

See #23222 which I now close as this one will replace it.
It is also a ping...

Set your browser preferred language to en-GB
Install a clean Joomla 4.
Select en-US as language.
Process installation until getting to the remove view.
Pass steps one after the other. en-US is kept as language and direction until getting to the index.php?view=remove&layout=default page where you can choose to Customise Installation or Complete and Open Site, or Complete & Open Admin
Look at source: the language has changed to en-GB.

I have also done the test by adding a 3.9.6 fr-FR language in installation.
In that case I have set the browser language to fr-FR and also used indifferently en-GB or en-US as installation language.
In that case, when getting to the remove view, the language is switched to fr-FR.

The conclusion is that the session language is lost and code checks again for LanguageHelper::detectLanguage(); when getting to the "remove" view.

I think it is time to correct that bug. Could not find how.

avatar infograf768 infograf768 - open - 6 Jun 2019
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jun 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Jun 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Jun 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 6 Jun 2019
avatar infograf768
infograf768 - comment - 6 Jun 2019

@franz-wohlkoenig
Please add this one to todo list to replace #23222

avatar infograf768
infograf768 - comment - 6 Jun 2019

You did it fine, thanks.

avatar brianteeman
brianteeman - comment - 6 Jun 2019

I can confirm this issue and to my unskilled eye the problem is that the value selected is NOT being stored in the session - so as soon as the page changes it reverts to the default because the code to get the value from the session always returns empty

avatar infograf768
infograf768 - comment - 6 Jun 2019

In fact, I think it is stored in the session. Tested by dumping Factory::getSession()->get('setup.options.language'); towards the end of InitialiseApp method.
It looks therefore that the session is deleted or reinitialized (new session) further down the process.

avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Jun 2019
Status New Discussion
avatar roland-d
roland-d - comment - 8 Jun 2019

What I have found so far is that the return session_name(); in the libraries/vendor/joomla/session/src/Storage/NativeStorage.php file a different session name returns when we get to the index.php?view=remove&layout=default page. This results in that the $_SESSION is not there with the Joomla data. Which results in Joomla not knowing the language for example.

I have yet to understand/find out why session_name returns a different name on this page.

@mbabker Any ideas?

avatar mbabker
mbabker - comment - 8 Jun 2019

Off the top of my head I think there’s something in the install app between
after the normal install finishes and the language install starts that
causes the session to be wiped. Maybe check the seed for the session name
in the config (DI service provider).

On Sat, Jun 8, 2019 at 10:46 AM Roland Dalmulder notifications@github.com
wrote:

What I have found so far is that the return session_name(); in the
libraries/vendor/joomla/session/src/Storage/NativeStorage.php file a
different session name returns when we get to the
index.php?view=remove&layout=default page. This results in that the
$_SESSION is not there with the Joomla data. Which results in Joomla not
knowing the language for example.

I have yet to understand/find out why session_name returns a different
name on this page.

@mbabker https://github.com/mbabker Any ideas?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/joomla/joomla-cms/issues/25130?email_source=notifications&email_token=AACZ7IJNWIPKI5TT3EW7RT3PZPH5XA5CNFSM4HU5NW5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXHXBVQ#issuecomment-500134102,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AACZ7IJC2SNGJTIOMS3VC3TPZPH5XANCNFSM4HU5NW5A
.

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
avatar roland-d
roland-d - comment - 9 Jun 2019

Blegh, still haven't been able to pinpoint the exact issue. A few more things have come to light. In the file libraries/src/Service/Provider/Session.php the getHash() of ApplicationHelperis called on line 102. The getHash() function gets the secret key from the config by doing Factory::getApplication()->get('secret') and this is a null value before Joomla is installed. After Joomla is installed this has a random value. This causes the 2 different session cookies/names.

By adding $config->set('secret', null); in the file installation/src/Application/InstallationApplication.php after line 65, we ensure the secret is always null in the installation. This gets us the same session name.

This is not enough. After the installation is done, Joomla wipes the configuration data including the language chosen by the user. What I need to find next is where this data is wiped so we can leave the language in there ensuring the language for the site remains.

$config->set('secret', null);

avatar brianteeman
brianteeman - comment - 15 Nov 2019

Please add a release blocker label to this on github

avatar Quy Quy - change - 15 Nov 2019
Labels Added: ?
avatar Quy Quy - labeled - 15 Nov 2019
avatar wilsonge
wilsonge - comment - 18 Nov 2019

For the installation app we might need to enforce not having the secret part of the session hash. As it's and known thing that it's going to change half way through the application.

avatar wilsonge
wilsonge - comment - 8 Jan 2020

Fix #27439

avatar wilsonge wilsonge - change - 8 Jan 2020
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2020-01-08 18:56:34
Closed_By wilsonge
avatar wilsonge wilsonge - close - 8 Jan 2020
avatar wilsonge wilsonge - change - 8 Jan 2020
Labels Removed: ?
avatar wilsonge wilsonge - unlabeled - 8 Jan 2020

Add a Comment

Login with GitHub to post a comment