This commit is contained in:
Laurent Destailleur 2021-12-19 20:28:27 +01:00
parent 4f572287dd
commit 13b17fa0da

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 && !array_key_exists($selected, $langs_available) && empty($showempty)) {
$tmparray = explode('_', $selected);
if (!empty($tmparray[1])) {
$selected = getLanguageCodeFromCountryCode($tmparray[1]);