From 54b467887baddf340b1b67bb161468c5e9b08b8c Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 1 May 2022 16:57:52 +0200 Subject: [PATCH] use correct array-structure for output of preconfig Signed-off-by: Michael Kaufmann --- admin_updates.php | 1 - install/updates/preconfig/preconfig_0.11.inc.php | 2 +- lib/Froxlor/Install/Preconfig.php | 11 +++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/admin_updates.php b/admin_updates.php index 5aa632dc..2416aead 100644 --- a/admin_updates.php +++ b/admin_updates.php @@ -123,7 +123,6 @@ if ($page == 'overview') { ]; $preconfig = Preconfig::getPreConfig(); - if (!empty($preconfig)) { $upd_formfield['updates']['sections'] = $preconfig; } diff --git a/install/updates/preconfig/preconfig_0.11.inc.php b/install/updates/preconfig/preconfig_0.11.inc.php index 3db101ce..28d8dc43 100644 --- a/install/updates/preconfig/preconfig_0.11.inc.php +++ b/install/updates/preconfig/preconfig_0.11.inc.php @@ -34,7 +34,7 @@ $preconfig = [ ]; $return = []; -if (Update::versionInUpdate($current_version, '0.10.99')) { +if (Update::versionInUpdate($current_version, '0.11.0-dev1')) { $description = 'We have rearranged the settings and split them into basic and advanced categories. This makes it easier for users who do not need all the detailed or very specific settings and options and gives a better overview of the basic/mostly used settings.'; $return['panel_settings_mode_note'] = ['type' => 'infotext', 'value' => $description]; $question = 'Chose settings mode (you can change that at any time)'; diff --git a/lib/Froxlor/Install/Preconfig.php b/lib/Froxlor/Install/Preconfig.php index e82315ea..da5c943a 100644 --- a/lib/Froxlor/Install/Preconfig.php +++ b/lib/Froxlor/Install/Preconfig.php @@ -61,7 +61,9 @@ class Preconfig */ public function addToPreConfig(array $array) { - $this->preconfig_data = $this->preconfig_data + $array; + if (isset($array['title']) && isset($array['fields']) && count($array['fields']) > 0) { + $this->preconfig_data[] = $array; + } } /** @@ -103,11 +105,8 @@ class Preconfig 'update_preconfig' => ['type' => 'hidden', 'value' => 1] ] ]; - $result = [ - $preconfig->getData(), - $agree - ]; - return $result; + $preconfig->addToPreConfig($agree); + return $preconfig->getData(); } return []; }