From 444bff5a07366df36eec65fb0e17a69ac40a754d Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 18 Jun 2023 09:05:24 +0200 Subject: [PATCH] fix settings (again) --- CHANGELOG.md | 5 +++++ _define.php | 2 +- dcstore.xml | 4 ++-- src/Config.php | 6 +++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64dfdc7..89ea243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ dev - [ ] fix third-party API (temp removed) - [ ] fix multiline translations +2023.06.18 +- require dotclear 2.26 +- require php 8.1+ +- fix settings (again) + 2023.05.13 - require dotclear 2.26 - require php 8.1+ diff --git a/_define.php b/_define.php index f978262..bfbd71f 100644 --- a/_define.php +++ b/_define.php @@ -18,7 +18,7 @@ $this->registerModule( 'Translater', 'Translate your Dotclear plugins and themes', 'Jean-Christian Denis & contributors', - '2023.05.13', + '2023.06.18', [ 'requires' => [ ['php', '8.1'], diff --git a/dcstore.xml b/dcstore.xml index a30cfeb..03b5442 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Translater - 2023.05.13 + 2023.06.18 Jean-Christian Denis & contributors Translate your Dotclear plugins and themes - https://github.com/JcDenis/translater/releases/download/v2023.05.13/plugin-translater.zip + https://github.com/JcDenis/translater/releases/download/v2023.06.18/plugin-translater.zip 2.26 https://plugins.dotaddict.org/dc2/details/translater http://forum.dotclear.org/viewtopic.php?id=39220 diff --git a/src/Config.php b/src/Config.php index 800a68b..5e507c3 100644 --- a/src/Config.php +++ b/src/Config.php @@ -56,7 +56,11 @@ class Config extends dcNsProcess try { foreach ($s->listSettings() as $key => $value) { - $s->writeSetting($key, $_POST[$key] ?? $value); + if (is_bool($value)) { + $s->writeSetting($key, !empty($_POST[$key])); + } else { + $s->writeSetting($key, $_POST[$key] ?? $value); + } } dcPage::addSuccessNotice(