N°2013 Setup : fix crash on setting readonly mode if initial DB info were wrong

Same as 15d3201a, but this error happened before compilation, when setting read only mode.
As before this is another fix for #351.

This fix introduces the new method \WizardController::GetParamForConfigArray
I replaced existing duplicate code with a call to this new generic method.
This commit is contained in:
Pierre Goiffon
2023-01-10 10:11:24 +01:00
parent d3d89b1ee2
commit 43d86ad8e2
6 changed files with 52 additions and 56 deletions

View File

@@ -165,14 +165,17 @@ class ApplicationInstaller
{
$sTargetEnvironment = $this->GetTargetEnv();
$sConfigFile = APPCONF.$sTargetEnvironment.'/'.ITOP_CONFIG_FILE;
try
{
return new Config($sConfigFile);
try {
$oConfig = new Config($sConfigFile);
}
catch (Exception $e)
{
catch (Exception $e) {
return null;
}
$aParamValues = $this->oParams->GetParamForConfigArray();
$oConfig->UpdateFromParams($aParamValues);
return $oConfig;
}
/**