diff --git a/datamodels/2.x/itop-core-update/src/Service/CoreUpdater.php b/datamodels/2.x/itop-core-update/src/Service/CoreUpdater.php index 3fac3040d..b60524866 100644 --- a/datamodels/2.x/itop-core-update/src/Service/CoreUpdater.php +++ b/datamodels/2.x/itop-core-update/src/Service/CoreUpdater.php @@ -155,7 +155,6 @@ final class CoreUpdater APPROOT.'extensions', ]; $aAvailableModules = $oRuntimeEnv->AnalyzeInstallation($oConfig, $aDirsToScanForModules); - $aSelectedModules = []; $oRuntimeEnv->CallInstallerHandlers($aAvailableModules, 'BeforeDatabaseCreation'); $oRuntimeEnv->CreateDatabaseStructure($oConfig, 'upgrade'); $oRuntimeEnv->CallInstallerHandlers($aAvailableModules, 'AfterDatabaseCreation'); @@ -180,7 +179,7 @@ final class CoreUpdater $oRuntimeEnv->RecordInstallation( $oConfig, $sDataModelVersion, - $aSelectedModules, + array_keys($aAvailableModules), $aSelectedExtensionCodes, 'Done by the iTop Core Updater' ); diff --git a/datamodels/2.x/itop-hub-connector/src/Controller/HubController.php b/datamodels/2.x/itop-hub-connector/src/Controller/HubController.php index fc0fccdae..0890891e3 100644 --- a/datamodels/2.x/itop-hub-connector/src/Controller/HubController.php +++ b/datamodels/2.x/itop-hub-connector/src/Controller/HubController.php @@ -209,7 +209,7 @@ class HubController $aSelectedExtensionCodes[] = $oExtension->sCode; } $aSelectedExtensions = $oExtensionsMap->GetChoices(); - $oRuntimeEnv->RecordInstallation($oConfig, $sDataModelVersion, $aAvailableModules, $aSelectedExtensionCodes, 'Done by the iTop Hub Connector'); + $oRuntimeEnv->RecordInstallation($oConfig, $sDataModelVersion, array_keys($aAvailableModules), $aSelectedExtensionCodes, 'Done by the iTop Hub Connector'); // Report the success in a way that will be detected by the ajax caller SetupLog::Info('Deployment successfully completed.'); diff --git a/setup/runtimeenv.class.inc.php b/setup/runtimeenv.class.inc.php index d57aaeebc..240d6e43b 100644 --- a/setup/runtimeenv.class.inc.php +++ b/setup/runtimeenv.class.inc.php @@ -548,7 +548,7 @@ class RunTimeEnvironment // Record installed modules and extensions // $aAvailableModules = $this->AnalyzeInstallation($oConfig, $this->GetBuildDir()); - foreach ($aSelectedModuleCodes as $sModuleId => $aData) { + foreach ($aSelectedModuleCodes as $sModuleId) { if (($sModuleId == ROOT_MODULE) || ($sModuleId == DATAMODEL_MODULE)) { continue; } @@ -869,7 +869,7 @@ class RunTimeEnvironment if (is_null($aSelectedModules) || in_array($sModuleId, $aSelectedModules)) { $aArgs = [MetaModel::GetConfig(), $aModule['installed_version'], $aModule['available_version']]; - RunTimeEnvironment::CallInstallerHandler($aAvailableModules[$sModuleId], $sHandlerName, $aArgs); + RunTimeEnvironment::CallInstallerHandler($aModule, $sHandlerName, $aArgs); } } } @@ -896,6 +896,7 @@ class RunTimeEnvironment try { call_user_func_array($aCallSpec, $aArgs); } catch (Exception $e) { + $sModuleId = isset($sModuleId) ? $sModuleId : ""; $sErrorMessage = "Module $sModuleId : error when calling module installer class $sModuleInstallerClass for $sHandlerName handler"; $aExceptionContextData = [ 'ModulelId' => $sModuleId, diff --git a/tests/php-unit-tests/integration-tests/itop-hub-connector/HubControllerTest.php b/tests/php-unit-tests/integration-tests/itop-hub-connector/HubControllerTest.php index fab403e50..fc34a6208 100644 --- a/tests/php-unit-tests/integration-tests/itop-hub-connector/HubControllerTest.php +++ b/tests/php-unit-tests/integration-tests/itop-hub-connector/HubControllerTest.php @@ -33,22 +33,16 @@ class HubControllerTest extends ItopDataTestCase $this->CopyProductionModulesIntoHubExtensionDir(); - touch(MFCompiler::USE_SYMBOLIC_LINKS_FILE_PATH); HubController::GetInstance()->SetOutputHeaders(false); - try { - HubController::GetInstance()->LaunchCompile(); - } catch (DOMFormatException $e) { - SetupLog::Error(__METHOD__, null, [ 'production.delta.xml' => @file_get_contents(APPROOT.'data/production.delta.xml')]); - throw $e; - } + HubController::GetInstance()->LaunchCompile(); $this->CheckReport('{"code":0,"message":"Ok","fields":[]}'); } public function testLaunchDeploy(): void { - $this->PrepareCompileAuthent(); + $this->testLaunchCompile(); HubController::GetInstance()->LaunchDeploy(); $this->CheckReport('{"code":0,"message":"Compilation successful.","fields":[]}'); } @@ -78,6 +72,7 @@ class HubControllerTest extends ItopDataTestCase $this->aFileToClean[] = $sExtensionDir; SetupUtils::rrmdir($sExtensionDir); + @mkdir($sExtensionDir); SetupUtils::copydir($sExtensionDir, $sProdModules); } }