From 40fccc74343df46ace926c933a961ea2fae082bb Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 20 Aug 2023 13:20:53 +0200 Subject: [PATCH] fix empty selection --- src/Config.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Config.php b/src/Config.php index 5c0101c..15dc588 100644 --- a/src/Config.php +++ b/src/Config.php @@ -60,7 +60,9 @@ class Config extends Process // write settings foreach ($s->dump() as $key => $value) { - if (is_bool($value)) { + if (is_array($value) && empty($_POST[My::id() . $key])) { + $s->set($key, []); + } elseif (is_bool($value)) { $s->set($key, !empty($_POST[My::id() . $key])); } else { $s->set($key, $_POST[My::id() . $key] ?: $value);