Language fallback behaviour can cause undesired language change

Kirby

Well-known member
Affected version
2.2.13
If xf_user.language_id contains the ID of a language that does not exist (any longer), runtime code will implicity fallback to the default language.

However, when editing language selection (either via ACP or public Account > Preferences) this is not taken into account.

As the language select only shows existing languages, the first entry will be selected implicitly.

This can cause undesired language changes for users.

Suggested Fix
1) Make the fallback explicit for the select (both ACP and public) and select the current default language when the user has a non-existing language_id
or
2) Add a new option Use default language (both for admin and public) and select this if the user has a non-existing language_id (Preferred)
 
Top Bottom