diff --git a/library/Icinga/User/Preferences/Store/IniStore.php b/library/Icinga/User/Preferences/Store/IniStore.php index acffff223..1693ba9ba 100644 --- a/library/Icinga/User/Preferences/Store/IniStore.php +++ b/library/Icinga/User/Preferences/Store/IniStore.php @@ -67,7 +67,7 @@ class IniStore extends PreferencesStore $this->getUser()->getUsername() ); } else { - $this->preferences = parse_ini_file($this->preferencesFile); + $this->preferences = parse_ini_file($this->preferencesFile, true); } } @@ -81,9 +81,13 @@ class IniStore extends PreferencesStore */ public function save(Preferences $preferences) { - $preferences = $preferences->toArray(); - $this->update(array_diff_assoc($preferences, $this->preferences)); - $this->delete(array_keys(array_diff_key($this->preferences, $preferences))); + $this->preferences = $preferences->toArray(); + + // TODO: Elaborate whether we need to patch the contents + // $preferences = $preferences->toArray(); + // $this->update(array_diff_assoc($preferences, $this->preferences)); + // $this->delete(array_keys(array_diff_key($this->preferences, $preferences))); + $this->write(); }