From 687f2aff1c9a134e508954191040c99c70d4fc13 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 5 Sep 2016 19:16:58 +0000 Subject: [PATCH] Settings: delete NULL-value settings --- library/Director/Settings.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/Director/Settings.php b/library/Director/Settings.php index 165416d2..214b2489 100644 --- a/library/Director/Settings.php +++ b/library/Director/Settings.php @@ -58,6 +58,17 @@ class Settings { $db = $this->db; + if ($value === null) { + $updated = $db->delete( + 'director_setting', + $db->quoteInto('setting_name = ?', $name) + ); + + unset($this->cache[$name]); + + return $this; + } + if ($this->getSetting($name) === $value) { return $this; }