[icinga-checkins] icinga.org: icingaweb2/feature/redesign-7144: Fix empty preferences array warning in the DbStore

git at icinga.org git at icinga.org
Thu Nov 13 21:22:56 CET 2014


Module: icingaweb2
Branch: feature/redesign-7144
Commit: c7f36a5afa08fcf6fb2678a0aff5dd087ad252ab
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=c7f36a5afa08fcf6fb2678a0aff5dd087ad252ab

Author: Alexander Fuhr <alexander.fuhr at netways.de>
Date:   Wed Nov 12 17:03:22 2014 +0100

Fix empty preferences array warning in the DbStore

---

 library/Icinga/User/Preferences/Store/DbStore.php |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/library/Icinga/User/Preferences/Store/DbStore.php b/library/Icinga/User/Preferences/Store/DbStore.php
index 1391b25..4d7b105 100644
--- a/library/Icinga/User/Preferences/Store/DbStore.php
+++ b/library/Icinga/User/Preferences/Store/DbStore.php
@@ -128,7 +128,9 @@ class DbStore extends PreferencesStore
             if (! array_key_exists($section, $this->preferences)) {
                 $this->preferences[$section] = array();
             }
-
+            if (! array_key_exists($section, $preferences)) {
+                $preferences[$section] = array();
+            }
             $toBeInserted = array_diff_key($preferences[$section], $this->preferences[$section]);
             if (!empty($toBeInserted)) {
                 $this->insert($toBeInserted, $section);



More information about the icinga-checkins mailing list