diff --git a/api/src/Preferences.php b/api/src/Preferences.php index bcaedee84b..748bd19f9b 100644 --- a/api/src/Preferences.php +++ b/api/src/Preferences.php @@ -891,8 +891,13 @@ class Preferences foreach($prefs as $app => $value) { // check if app preferences have changed, if not no need to save them - if ($old_prefs && !array_diff_assoc($old_prefs[$app] ?? [], $value)) continue; - + // we use two seemingly identical conditions (== and !array_diff_assoc()), as both are necessary + // to handle values like "" and "0" correctly (not skip updating the prefs) + if (!empty($old_prefs[$app]) && $old_prefs[$app] == $value && + !array_diff_assoc($old_prefs[$app] ?? [], $value)) + { + continue; + } if (!$changed++) $this->db->transaction_begin(); if (!is_array($value) || !$value)