From 581281ddf5f7e5c6523c858ce49e846eb0c46371 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Fri, 20 Feb 2026 17:20:44 +0100 Subject: also convert default config values when creating configurations, fixes #6286 --- lib/classes/Config.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/classes/Config.php b/lib/classes/Config.php index 20eebdc..d3e5419 100644 --- a/lib/classes/Config.php +++ b/lib/classes/Config.php @@ -349,6 +349,15 @@ class Config implements ArrayAccess, Countable, IteratorAggregate if (!$entry->isNew()) { throw new InvalidArgumentException("config $field already exists"); } + + if (isset($data['value'])) { + $data['value'] = $this->convertForDatabase( + $data['type'] ?? 'string', + $data['value'], + $field + ); + } + $entry->setData($data); $ret = $entry->store() ? $entry : null; if ($ret) { -- cgit v1.0