Closed texnixe closed 3 years ago
So solution could be to clear the session value when logging in successfully? That way it should reset the behavior to the default language.
That makes sense! Basically $session->remove('panel.language');
.
OK I think I misread @texnixe's description. When testing the bug myself, it occurred to me that not the session is the problem (which could be fixed by its removal), but rather that even if I delete all sessions, cookies... myself before logging in, the content language switcher defaults to English instead of the default language German.
My current guess is, that somewhere instead of the default content language, the default Panel UI language is chosen or something like that.
Seems to be a backende problem. This line https://github.com/getkirby/kirby/blob/develop/src/Panel/View.php#L152 already returns the English language object.
I just deleted every cache/session file and logged in again and the content language was still in English while panel language was set to German. This should be the same by default and only different if the user changes it.
@MaluNoPeleke That's what I just wrote 😄
✅
Describe the bug
In Kirby 3.5.7.1 (and probably earlier versions), when you have a multi-language setup with German as default and English as secondary language, and you log in to the Panel, the content language switcher defaults to the default language (in this case this would be German).
From my tests it seems as if Kirby remembers which language version I was working on last, because when I log out while in the German default translation and then log back in, I am back in the German version. However, when cookies and sessions are deleted, I return to the English version. This happens independent of the selected user language.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect the same behavior as in 3.5.7.1.
Kirby Version
Tested with 3.6.0-alpha-4
Desktop (please complete the following information):
Mac OS11.2.2 with Firefox 91.0 (64-bit)
Additional context
https://forum.getkirby.com/t/default-language-not-used-after-login/23207/5