Merge pull request #19599 from Je2fb/develop

Fix #19418
This commit is contained in:
Laurent Destailleur 2021-12-16 17:38:38 +01:00 committed by GitHub
commit 9b9cb6842e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,7 @@ class FormAdmin
// If the language to select is not inside the list of available language and empty value is not available, we must find
// an alternative as the language code to pre-select (to avoid to have first element in list pre-selected).
if ($selected && !in_array($selected, $langs_available) && empty($showempty)) {
if ($selected && !isset($langs_available[$selected]) && empty($showempty)) {
$tmparray = explode('_', $selected);
if (!empty($tmparray[1])) {
$selected = getLanguageCodeFromCountryCode($tmparray[1]);