From 596c62aec873d07f62e7a616d398881f086ba96e Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 3 Jun 2022 09:53:30 +0200 Subject: [PATCH 1/7] =?UTF-8?q?:bulb:=20N=C2=B04867=20Add=20bug=20referenc?= =?UTF-8?q?e=20in=20phpdoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e4bf72d05..f354ee5d2 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) { From 3ea82e37d5a57358a5dd689f3e88f9ba1404bd5c Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 3 Jun 2022 18:00:29 +0200 Subject: [PATCH 2/7] =?UTF-8?q?N=C2=B04635=20Report=20\LogChannels::NOTIFI?= =?UTF-8?q?CATIONS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/log.class.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/log.class.inc.php b/core/log.class.inc.php index c7a56c277..9facb1599 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -551,6 +551,13 @@ class LogChannels const INLINE_IMAGE = 'InlineImage'; + /** + * @var string + * @since 3.0.1 N°4849 + * @since 2.7.7 N°4635 + */ + const NOTIFICATIONS = 'notifications'; + const PORTAL = 'portal'; } From 34bed5ec4fd19e252f324aa33df2403bb06c9800 Mon Sep 17 00:00:00 2001 From: Benjamin Dalsass Date: Tue, 7 Jun 2022 11:14:26 +0200 Subject: [PATCH 3/7] =?UTF-8?q?N=C2=B05215=20-=20Portal=20insufficient=20a?= =?UTF-8?q?ccess=20control=20for=20ajax=20search=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ajax.searchform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/ajax.searchform.php b/pages/ajax.searchform.php index cf6ebae27..e6e3c9572 100644 --- a/pages/ajax.searchform.php +++ b/pages/ajax.searchform.php @@ -37,7 +37,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'); } From cdd7dcdc5cc27fc7454eac23cc2430a1c59b8234 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 8 Jun 2022 10:12:19 +0200 Subject: [PATCH 4/7] =?UTF-8?q?N=C2=B05211=20-=20Core=20update=20not=20wor?= =?UTF-8?q?king=20with=20auto-selected=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Service/RunTimeEnvironmentCoreUpdater.php | 14 +------------- setup/modelfactory.class.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 15 deletions(-) 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 6715878e0..5164e428a 100644 --- a/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php +++ b/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php @@ -138,19 +138,7 @@ class RunTimeEnvironmentCoreUpdater extends RunTimeEnvironment { 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(); diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 4daeedbdd..123e5cca3 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -944,9 +944,9 @@ class ModelFactory $aLoadedModuleNames = array(); foreach (self::$aLoadedModules as $oModule) { - $aLoadedModuleNames[] = $oModule->GetName(); + $aLoadedModuleNames[] = $oModule->GetName().':'.$oModule->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)); } } From 9e314ba77b5acdc252b910c77c2ed24bfde8fd13 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 8 Jun 2022 10:24:03 +0200 Subject: [PATCH 5/7] =?UTF-8?q?N=C2=B05211=20-=20Core=20update=20not=20wor?= =?UTF-8?q?king=20with=20auto-selected=20modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Service/RunTimeEnvironmentCoreUpdater.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5164e428a..3c27c3fb3 100644 --- a/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php +++ b/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php @@ -150,7 +150,7 @@ class RunTimeEnvironmentCoreUpdater extends RunTimeEnvironment 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]; } } From 9674378c56491bbdb5945a3bfe63c99029bc1a97 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 8 Jun 2022 10:36:55 +0200 Subject: [PATCH 6/7] =?UTF-8?q?N=C2=B05211=20-=20Core=20update=20not=20wor?= =?UTF-8?q?king=20with=20auto-selected=20modules=20(comments)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Service/RunTimeEnvironmentCoreUpdater.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 3c27c3fb3..d28a684d1 100644 --- a/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php +++ b/datamodels/2.x/itop-core-update/src/Service/RunTimeEnvironmentCoreUpdater.php @@ -132,7 +132,7 @@ 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)) { @@ -147,6 +147,7 @@ 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) { From 4c585614cdc1f8ecfaf0f25b213f659559406aa3 Mon Sep 17 00:00:00 2001 From: odain Date: Wed, 8 Jun 2022 11:07:31 +0200 Subject: [PATCH 7/7] ease testing: CreateTestOrganization returns org object --- test/ItopDataTestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ItopDataTestCase.php b/test/ItopDataTestCase.php index 89a0fd1d2..97ed4b2ce 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; }