mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 15:33:23 +01:00
fixing the fix ;) using both, the old and the new condition is necessary to correctly saving all preferences
This commit is contained in:
parent
c76ca96b5d
commit
b0cf9bd70f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user