diff --git a/core/log.class.inc.php b/core/log.class.inc.php index ff6d78fc1..e566d0a1e 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -547,6 +547,7 @@ class LogChannels /** * @var string * @since 3.0.1 N°4849 + * @since 2.7.7 N°4635 */ public const NOTIFICATIONS = 'notifications'; diff --git a/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php b/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php index f3fab68c8..c61318291 100644 --- a/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php +++ b/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php @@ -132,25 +132,13 @@ class RunTimeEnvironmentCoreUpdater extends RunTimeEnvironment { $aRet = parent::GetMFModulesToCompile($sSourceEnv, $sSourceDir); - // Add new mandatory modules + // Add new mandatory modules from datamodel 2.x only $sSourceDirFull = APPROOT.$sSourceDir; if (!is_dir($sSourceDirFull)) { throw new Exception("The source directory '$sSourceDirFull' does not exist (or could not be read)"); } - $aDirsToCompile = array($sSourceDirFull); - if (is_dir(APPROOT.'extensions')) - { - $aDirsToCompile[] = APPROOT.'extensions'; - } - $sExtraDir = APPROOT.'data/'.$this->sTargetEnv.'-modules/'; - if (is_dir($sExtraDir)) - { - $aDirsToCompile[] = $sExtraDir; - } - - $aExtraDirs = $this->GetExtraDirsToScan($aDirsToCompile); - $aDirsToCompile = array_merge($aDirsToCompile, $aExtraDirs); + $aDirsToCompile = [$sSourceDirFull]; $oFactory = new ModelFactory($aDirsToCompile); $aModules = $oFactory->FindModules(); @@ -159,10 +147,11 @@ class RunTimeEnvironmentCoreUpdater extends RunTimeEnvironment foreach ($aModules as $oModule) { $aAvailableModules[$oModule->GetName()] = $oModule; } + // TODO check the auto-selected modules here foreach($this->oExtensionsMap->GetAllExtensions() as $oExtension) { if ($oExtension->bMarkedAsChosen) { foreach ($oExtension->aModules as $sModuleName) { - if (!isset($aRet[$sModuleName])) { + if (!isset($aRet[$sModuleName]) && isset($aAvailableModules[$sModuleName])) { $aRet[$sModuleName] = $aAvailableModules[$sModuleName]; } } diff --git a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php index 5c59b95b7..48e5cd1be 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php @@ -91,7 +91,7 @@ class ObjectFormManager extends FormManager * @return array formmanager_data as a PHP array * * @since 2.7.6 3.0.0 N°4384 method creation : factorize as this is used twice now - * @since 2.7.7 3.0.1 only used once but kept + * @since 2.7.7 3.0.1 N°4867 now only used once, but we decided to keep this method anyway */ protected static function DecodeFormManagerData($formManagerData) { diff --git a/pages/ajax.searchform.php b/pages/ajax.searchform.php index ae9067e28..c63815c1e 100644 --- a/pages/ajax.searchform.php +++ b/pages/ajax.searchform.php @@ -18,7 +18,7 @@ try $oKPI->ComputeAndReport('Data model loaded'); $oKPI = new ExecutionKPI(); - if (LoginWebPage::EXIT_CODE_OK != LoginWebPage::DoLoginEx(null /* any portal */, false, LoginWebPage::EXIT_RETURN)) + if (LoginWebPage::EXIT_CODE_OK != LoginWebPage::DoLoginEx('backoffice', false, LoginWebPage::EXIT_RETURN)) { throw new SecurityException('You must be logged in'); } diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index b165222cf..603e337f2 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -961,9 +961,9 @@ class ModelFactory catch (Exception $e) { $aLoadedModuleNames = array(); foreach (self::$aLoadedModules as $oLoadedModule) { - $aLoadedModuleNames[] = $oLoadedModule->GetName(); + $aLoadedModuleNames[] = $oLoadedModule->GetName().':'.$oLoadedModule->GetVersion(); } - throw new Exception('Error loading module "'.$oModule->GetName().'": '.$e->getMessage().' - Loaded modules: '.implode(',', + throw new Exception('Error loading module "'.$oModule->GetName().'": '.$e->getMessage().' - Loaded modules: '.implode(', ', $aLoadedModuleNames)); } } diff --git a/test/ItopDataTestCase.php b/test/ItopDataTestCase.php index e6f5d01db..ad43fa5d9 100644 --- a/test/ItopDataTestCase.php +++ b/test/ItopDataTestCase.php @@ -785,6 +785,7 @@ class ItopDataTestCase extends ItopTestCase // Create a specific organization for the tests $oOrg = $this->CreateOrganization('UnitTestOrganization'); $this->iTestOrgId = $oOrg->GetKey(); + return $oOrg; } /**