diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-02-20 17:20:44 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-02-20 17:34:47 +0100 |
| commit | 581281ddf5f7e5c6523c858ce49e846eb0c46371 (patch) | |
| tree | b18736c3a24857899c055653673e43f211be629f | |
| parent | 4145100a0f2fdd412dafab99c41ddd998d9ad4b3 (diff) | |
also convert default config values when creating configurations, fixes #6286biest-6286
| -rw-r--r-- | lib/classes/Config.php | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |
