Preferences: Fix some default values were not shown correctly

Preferences that had options with label & value keys were done by index instead of value
This commit is contained in:
nathan 2023-06-15 10:11:04 -06:00
parent b2c44b9b5c
commit f8ef7d5fe7

View File

@ -685,11 +685,11 @@ class preferences_settings
}
foreach($labels as &$def)
{
if (isset($values[$def]))
if(isset($values[$def]) && (!is_array($values[$def]) || $values[$def]['value'] == $def))
{
$def = is_array($values[$def]) ? $values[$def]['label'] : $values[$def];
}
else // value could be in an optgroup
else // value could be in an optgroup or array with label & value keys
{
foreach($values as $value)
{