From 4900196f4ccc7681a71bcd6a0dfbfa8e71bafae5 Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Thu, 24 Sep 2020 21:45:57 +0100 Subject: [PATCH] Show/hide correct database fields on initial load On the initial load the form morphology hook is called prior to the morphology being populated with values from the model. Loading from the YAML won't always work if we're coming from < 0.7.0. Loading from the model is safe as: - The model is initially populated with the YAML - If legacy config is present then the model is updated with that - If this isn't the initial load we go down the submitted branch instead --- .../BaikalAdmin/Controller/Install/Database.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Core/Frameworks/BaikalAdmin/Controller/Install/Database.php b/Core/Frameworks/BaikalAdmin/Controller/Install/Database.php index d6d98d3..bb96885 100644 --- a/Core/Frameworks/BaikalAdmin/Controller/Install/Database.php +++ b/Core/Frameworks/BaikalAdmin/Controller/Install/Database.php @@ -215,12 +215,8 @@ class Database extends \Flake\Core\Controller { if ($oForm->submitted()) { $bMySQL = (intval($oForm->postValue("mysql")) === 1); } else { - try { - $configSystem = Yaml::parseFile(PROJECT_PATH_CONFIG . "baikal.yaml"); - } catch (\Exception $e) { - error_log('Error reading baikal.yaml file : ' . $e->getMessage()); - } - $bMySQL = $configSystem['database']['mysql'] ?? true; + // oMorpho won't have the values from the model set on it yet + $bMySQL = $this->oModel->get("mysql"); } if ($bMySQL === true) {