Merge remote-tracking branch 'origin/support/2.7' into support/3.0

# Conflicts:
#	core/log.class.inc.php
#	setup/modelfactory.class.inc.php
This commit is contained in:
Benjamin Dalsass
2022-06-08 12:38:41 +02:00
6 changed files with 10 additions and 19 deletions

View File

@@ -547,6 +547,7 @@ class LogChannels
/**
* @var string
* @since 3.0.1 N°4849
* @since 2.7.7 N°4635
*/
public const NOTIFICATIONS = 'notifications';

View File

@@ -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];
}
}

View File

@@ -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)
{

View File

@@ -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');
}

View File

@@ -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));
}
}

View File

@@ -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;
}
/**