getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.31k stars 168 forks source link

[Panel] User settings: Wrong language code is displayed after user language change #1288

Closed SebastianEberlein closed 5 years ago

SebastianEberlein commented 5 years ago

Describe the bug When I change the user language in the user settings page, the language info next to the user profile image displays the wrong language code.

To Reproduce Steps to reproduce the behavior:

  1. Open the user settings for a user.
  2. Change the language

Expected behavior Display the correct language string. Maybe display the actual language name instead of just the language code...

Screenshots vid

Additional Information I disabled

  'panel' => [
    'language' => 'de'
  ]

in the config.php, but it does not seem to make a difference.

Kirby Version 3.0.0-RC-1.2

SebastianEberlein commented 5 years ago

Also this happens sometimes:

bastianallgeier commented 5 years ago

Ugh, I cannot reproduce any of this. This is also Chrome, right?

SebastianEberlein commented 5 years ago

Yes, Chrome. But also Safari and Firefox.

To be sure it’s not just my Kirby installation, I upload the RC1 starterkit to our webserver: The language display bug still occurs.

bastianallgeier commented 5 years ago

Could you let me know if you still run into the issue with RC2?

SebastianEberlein commented 5 years ago

Yes, still happens with RC2. To be extra sure, I disabled any Adblocker and used a different internet connection.

I can also reproduce the issue by changing the user language in the user list view – via the context menu – and then opening the user page.

But if I then go back to the user list and now open the user page again, the language code is displayed correctly.

bastianallgeier commented 5 years ago

Is it possible that your localstorage is blocked somehow?

SebastianEberlein commented 5 years ago

No, when I make changes to any field, I can see in the dev tools that the localstorage shows a key value pair.

I looked at the fetch request for the user data after I changed the user language: It shows the old language value. (Although the cache is disabled in the dev tools.)

But: I just tested the RC2 starterkit with the built-in PHP server, as described here. And it works as expected.

So both my local vagrant machine and our webserver seem to cause the problem.

SebastianEberlein commented 5 years ago

I just tested it on a different Apache webserver, that has been setup just a few days ago: It works as expected.

Our webserver uses Apache 2 with nginx reverse proxy. My vagrant machine just uses Apache 2.

bastianallgeier commented 5 years ago

Seeing more users having similar caching issues and you describing that it works on a different server setup makes me think that it might have something to do with server side caching. Could you check if you have some heavy caching activated?

SebastianEberlein commented 5 years ago

My vagrant environment has indeed OPcache enabled. If I set php_flag opcache.enable Off in my .htaccess, the language is displayed correctly :)

But I do not know if it is a good idea to disable OPcache performance-wise...

SebastianEberlein commented 5 years ago

Setting php_value opcache.revalidate_freq 0 in my .htaccess also solves the issue.

The default value is 2. Setting it to 1 does not solve the issue.

bastianallgeier commented 5 years ago

Ok, that's at least a fix. We had problems with opcache in v2 as well. It's often too aggressive and doesn't update the response properly.

bastianallgeier commented 5 years ago

I'm closing this for now and we will add a note to our troubleshooting guide