From 9b6a14f2d8ec1bb8959db252d7b01655a0567518 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 15 Jun 2023 10:11:04 -0600 Subject: [PATCH] Preferences: Fix some default values were not shown correctly Preferences that had options with label & value keys were done by index instead of value --- preferences/inc/class.preferences_settings.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/preferences/inc/class.preferences_settings.inc.php b/preferences/inc/class.preferences_settings.inc.php index 3386e73ee4..49705e5c92 100644 --- a/preferences/inc/class.preferences_settings.inc.php +++ b/preferences/inc/class.preferences_settings.inc.php @@ -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) {