From 9483c6cf6759364678ca37d3f8379d35c72a8675 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 16 Jan 2015 23:20:59 +0100 Subject: Fix bug if a shortcut is not in the initial config A new shortcut was never saved because ConfigurationSetter never set a shortcut which did not appear in the initial conf. --- app/Models/ConfigurationSetter.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/Models/ConfigurationSetter.php') diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index f1c465c7c..e808630b4 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -154,9 +154,7 @@ class FreshRSS_ConfigurationSetter { private function _shortcuts(&$data, $values) { foreach ($values as $key => $value) { - if (isset($data['shortcuts'][$key])) { - $data['shortcuts'][$key] = $value; - } + $data['shortcuts'][$key] = $value; } } -- cgit v1.2.3 From 409e09f68516be23f564be81f82f3a8af10a0bbf Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 16 Jan 2015 23:38:12 +0100 Subject: Simplify shortcut setter --- app/Models/ConfigurationSetter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/Models/ConfigurationSetter.php') diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index e808630b4..7fd0836c1 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -153,9 +153,11 @@ class FreshRSS_ConfigurationSetter { } private function _shortcuts(&$data, $values) { - foreach ($values as $key => $value) { - $data['shortcuts'][$key] = $value; + if (!is_array($values)) { + return; } + + $data['shortcuts'] = $values; } private function _sort_order(&$data, $value) { -- cgit v1.2.3 From 711ef5546cd218f81595e6e3b479b929ffeb3bc7 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 18 Jan 2015 13:04:08 +0100 Subject: Fix mark_when setter mark_when was not taken in consideration. --- app/Models/ConfigurationSetter.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/Models/ConfigurationSetter.php') diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index 7fd0836c1..eeb1f2f4c 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -210,9 +210,7 @@ class FreshRSS_ConfigurationSetter { private function _mark_when(&$data, $values) { foreach ($values as $key => $value) { - if (isset($data['mark_when'][$key])) { - $data['mark_when'][$key] = $this->handleBool($value); - } + $data['mark_when'][$key] = $this->handleBool($value); } } -- cgit v1.2.3