mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°9134 Validate extension codes before installation and refine progress message styling (#909)
* N°9134 Validate extension codes before installation and refine progress message styling * Add test for compile failure when extension code is missing
This commit is contained in:
@@ -1467,6 +1467,14 @@ class RunTimeEnvironment
|
||||
// Removed modules are stored as static for FindModules()
|
||||
$oExtensionsMap->DeclareExtensionAsRemoved($aRemovedExtensionCodes);
|
||||
|
||||
// Check that all the extensions have a code
|
||||
foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) {
|
||||
if (empty($oExtension->sCode)) {
|
||||
$sExtensionLabel = !empty($oExtension->sLabel) ? $oExtension->sLabel : $oExtension->sSourceDir;
|
||||
throw new Exception(sprintf('Extension "%s" cannot be installed: Missing extension code', $sExtensionLabel));
|
||||
}
|
||||
}
|
||||
|
||||
$oFactory = new ModelFactory($aDirsToScan);
|
||||
|
||||
$oDictModule = new MFDictModule('dictionaries', 'iTop Dictionaries', APPROOT.'dictionaries');
|
||||
@@ -1566,7 +1574,7 @@ class RunTimeEnvironment
|
||||
|
||||
public function ExitMaintenanceMode(): void
|
||||
{
|
||||
if (SetupUtils::IsInMaintenanceMode()){
|
||||
if (SetupUtils::IsInMaintenanceMode()) {
|
||||
SetupUtils::ExitMaintenanceMode();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user