diff --git a/setup/applicationinstaller.class.inc.php b/setup/applicationinstaller.class.inc.php index 692235606..ca4836085 100644 --- a/setup/applicationinstaller.class.inc.php +++ b/setup/applicationinstaller.class.inc.php @@ -685,6 +685,11 @@ class ApplicationInstaller */ protected static function DoUpdateDBSchema($aSelectedModules, $sModulesDir, $aParamValues, $sTargetEnvironment = '', $bOldAddon = false, $sAppRootUrl = '') { + /** + * @since 3.2.0 move the ContextTag init at the very beginning of the method + * @noinspection PhpUnusedLocalVariableInspection + */ + $oContextTag = new ContextTag(ContextTag::TAG_SETUP); SetupLog::Info("Update Database Schema for environment '$sTargetEnvironment'."); $sMode = $aParamValues['mode']; $sDBPrefix = $aParamValues['db_prefix']; @@ -703,7 +708,6 @@ class ApplicationInstaller $oProductionEnv = new RunTimeEnvironment($sTargetEnvironment); $oProductionEnv->InitDataModel($oConfig, true); // load data model only - $oContextTag = new ContextTag(ContextTag::TAG_SETUP); // Migrate columns self::MoveColumns($sDBPrefix); @@ -886,6 +890,11 @@ class ApplicationInstaller $bOldAddon ) { + /** + * @since 3.2.0 move the ContextTag init at the very beginning of the method + * @noinspection PhpUnusedLocalVariableInspection + */ + $oContextTag = new ContextTag(ContextTag::TAG_SETUP); SetupLog::Info('After Database Creation'); $sMode = $aParamValues['mode']; @@ -902,8 +911,7 @@ class ApplicationInstaller $oProductionEnv = new RunTimeEnvironment($sTargetEnvironment); $oProductionEnv->InitDataModel($oConfig, true); // load data model and connect to the database - $oContextTag = new ContextTag(ContextTag::TAG_SETUP); - self::$bMetaModelStarted = true; // No need to reload the final MetaModel in case the installer runs synchronously + self::$bMetaModelStarted = true; // No need to reload the final MetaModel in case the installer runs synchronously // Perform here additional DB setup... profiles, etc... // @@ -952,6 +960,12 @@ class ApplicationInstaller $bSampleData = false ) { + /** + * @since 3.2.0 move the ContextTag init at the very beginning of the method + * @noinspection PhpUnusedLocalVariableInspection + */ + $oContextTag = new ContextTag(ContextTag::TAG_SETUP); + $oConfig = new Config(); $oConfig->UpdateFromParams($aParamValues, $sModulesDir); @@ -969,7 +983,6 @@ class ApplicationInstaller if (!self::$bMetaModelStarted) { $oProductionEnv->InitDataModel($oConfig, false); // load data model and connect to the database - $oContextTag = new ContextTag(ContextTag::TAG_SETUP); self::$bMetaModelStarted = true; // No need to reload the final MetaModel in case the installer runs synchronously } @@ -1002,6 +1015,12 @@ class ApplicationInstaller $sModulesDir, $sPreviousConfigFile, $sTargetEnvironment, $sDataModelVersion, $bOldAddon, $aSelectedModuleCodes, $aSelectedExtensionCodes, $aParamValues, $sInstallComment = null ) { + /** + * @since 3.2.0 move the ContextTag init at the very beginning of the method + * @noinspection PhpUnusedLocalVariableInspection + */ + $oContextTag = new ContextTag(ContextTag::TAG_SETUP); + $aParamValues['selected_modules'] = implode(',', $aSelectedModuleCodes); $sMode = $aParamValues['mode']; @@ -1042,7 +1061,6 @@ class ApplicationInstaller // Record which modules are installed... $oProductionEnv = new RunTimeEnvironment($sTargetEnvironment); $oProductionEnv->InitDataModel($oConfig, true); // load data model and connect to the database - $oContextTag = new ContextTag(ContextTag::TAG_SETUP); if (!$oProductionEnv->RecordInstallation($oConfig, $sDataModelVersion, $aSelectedModuleCodes, $aSelectedExtensionCodes, $sInstallComment)) { diff --git a/setup/wizardcontroller.class.inc.php b/setup/wizardcontroller.class.inc.php index 97c9115ea..1f0846f34 100644 --- a/setup/wizardcontroller.class.inc.php +++ b/setup/wizardcontroller.class.inc.php @@ -285,6 +285,12 @@ on the page's parameters */ public function Run() { + /** + * @since 3.2.0 Add the ContextTag init + * @noinspection PhpUnusedLocalVariableInspection + */ + $oContextTag = new ContextTag(ContextTag::TAG_SETUP); + $sOperation = utils::ReadParam('operation'); $this->aParameters = utils::ReadParam('_params', array(), false, 'raw_data'); $this->aSteps = json_decode(utils::ReadParam('_steps', '[]', false, 'raw_data'), true /* bAssoc */);