From 4f6dab458d1a272b45c7f631ff4ae27ab7c1ad98 Mon Sep 17 00:00:00 2001 From: "lenaick.moreira" Date: Tue, 21 Jul 2026 15:09:24 +0200 Subject: [PATCH 1/3] =?UTF-8?q?N=C2=B09827=20-=20Unable=20to=20launch=20ch?= =?UTF-8?q?eck=20compatibility=20when=20a=20module=20with=20bad=20dependen?= =?UTF-8?q?cies=20is=20in=20production-modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/wizardsteps/WizStepModulesChoice.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup/wizardsteps/WizStepModulesChoice.php b/setup/wizardsteps/WizStepModulesChoice.php index 567c5f6ea8..67d283d8fc 100644 --- a/setup/wizardsteps/WizStepModulesChoice.php +++ b/setup/wizardsteps/WizStepModulesChoice.php @@ -759,8 +759,8 @@ public function ComputeChoiceFlags(array $aChoice, string $sChoiceId, array $aSe $bDisabled = true; $bChecked = false; } elseif ($bDependencyIssue) { - $bDisabled = true; - $bChecked = false; + $bDisabled = !$bDisableUninstallCheck; + $bChecked = true; } elseif ($bMandatory) { $bDisabled = true; $bChecked = true; @@ -813,6 +813,9 @@ public function DisplayOptions($oPage, $aStepInfo, $aSelectedComponents, $aDefau if ($aFlags['disabled'] && !$aFlags['checked'] && !$bDisableUninstallCheck && (!$aFlags['uninstallable'] || $aFlags['mandatory'])) { $this->bCanMoveForward = false;//Disable "Next" + } elseif (!$bDisableUninstallCheck && $aFlags['dependency_issue']) { + //If there is a dependency issue, the user cannot move forward without forced uninstall + $this->bCanMoveForward = false; } $this->DisplayChoice($oPage, $aChoice, $aSelectedComponents, $aDefaults, $sChoiceId, $sChoiceId, $aFlags); From 7a50e2ea450be783f658c770c7608190c7000243 Mon Sep 17 00:00:00 2001 From: "lenaick.moreira" Date: Tue, 21 Jul 2026 17:11:57 +0200 Subject: [PATCH 2/3] Update unit tests --- .../setup/WizStepModulesChoiceTest.php | 62 +++++++++++++++++-- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php b/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php index 66dd565c54..0cd708ef21 100644 --- a/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php @@ -394,7 +394,7 @@ public function ProviderComputeChoiceFlags() 'mandatory' => false, ], ], - 'A non installed extension with missing dependencies should be not checked and disabled' => [ + 'A non installed extension with missing dependencies and without force uninstall should be checked and disabled' => [ 'aExtensionsOnDiskOrDb' => [ 'itop-ext1' => [ 'installed' => false, @@ -416,12 +416,12 @@ public function ProviderComputeChoiceFlags() 'missing' => false, 'installed' => false, 'disabled' => true, - 'checked' => false, + 'checked' => true, 'dependency_issue' => true, 'mandatory' => false, ], ], - 'An installed extension with missing dependencies should be not checked and disabled' => [ + 'An installed extension with missing dependencies and without force uninstall should be checked and disabled' => [ 'aExtensionsOnDiskOrDb' => [ 'itop-ext1' => [ 'installed' => true, @@ -443,7 +443,61 @@ public function ProviderComputeChoiceFlags() 'missing' => false, 'installed' => true, 'disabled' => true, - 'checked' => false, + 'checked' => true, + 'dependency_issue' => true, + 'mandatory' => false, + ], + ], + 'A non installed extension with missing dependencies and force uninstall should be checked and enabled' => [ + 'aExtensionsOnDiskOrDb' => [ + 'itop-ext1' => [ + 'installed' => false, + 'missing_dependencies' => [ + 'itop-ext1-1', + ], + ], + ], + 'aWizardStepDefinition' => [ + 'extension_code' => 'itop-ext1', + 'mandatory' => false, + 'uninstallable' => true, + 'missing_dependencies' => true, + ], + 'bCurrentSelected' => false, + 'bDisableUninstallChecks' => true, + 'aExpectedFlags' => [ + 'uninstallable' => true, + 'missing' => false, + 'installed' => false, + 'disabled' => false, + 'checked' => true, + 'dependency_issue' => true, + 'mandatory' => false, + ], + ], + 'An installed extension with missing dependencies and force uninstall should be checked and enabled' => [ + 'aExtensionsOnDiskOrDb' => [ + 'itop-ext1' => [ + 'installed' => true, + 'missing_dependencies' => [ + 'itop-ext1-1', + ], + ], + ], + 'aWizardStepDefinition' => [ + 'extension_code' => 'itop-ext1', + 'mandatory' => false, + 'uninstallable' => true, + 'missing_dependencies' => true, + ], + 'bCurrentSelected' => false, + 'bDisableUninstallChecks' => true, + 'aExpectedFlags' => [ + 'uninstallable' => true, + 'missing' => false, + 'installed' => true, + 'disabled' => false, + 'checked' => true, 'dependency_issue' => true, 'mandatory' => false, ], From 29b82e020008beddd6f212e33f4c13dd690c3786 Mon Sep 17 00:00:00 2001 From: "lenaick.moreira" Date: Wed, 22 Jul 2026 17:27:47 +0200 Subject: [PATCH 3/3] =?UTF-8?q?N=C2=B09827=20-=20Unable=20to=20launch=20ch?= =?UTF-8?q?eck=20compatibility=20when=20a=20module=20with=20bad=20dependen?= =?UTF-8?q?cies=20is=20in=20production-modules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/wizardsteps/WizStepModulesChoice.php | 5 +- .../setup/WizStepModulesChoiceTest.php | 70 ++++++++++++++++--- 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/setup/wizardsteps/WizStepModulesChoice.php b/setup/wizardsteps/WizStepModulesChoice.php index 67d283d8fc..9afb266cb7 100644 --- a/setup/wizardsteps/WizStepModulesChoice.php +++ b/setup/wizardsteps/WizStepModulesChoice.php @@ -758,12 +758,11 @@ public function ComputeChoiceFlags(array $aChoice, string $sChoiceId, array $aSe if ($bMissingFromDisk) { $bDisabled = true; $bChecked = false; - } elseif ($bDependencyIssue) { - $bDisabled = !$bDisableUninstallCheck; - $bChecked = true; } elseif ($bMandatory) { $bDisabled = true; $bChecked = true; + } elseif ($bDependencyIssue) { + $bDisabled = !$bDisableUninstallCheck; } elseif ($bInstalled && !$bCanBeUninstalled && !$bDisableUninstallCheck) { $bChecked = true; $bDisabled = true; diff --git a/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php b/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php index 0cd708ef21..c3a2084da2 100644 --- a/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php @@ -394,7 +394,7 @@ public function ProviderComputeChoiceFlags() 'mandatory' => false, ], ], - 'A non installed extension with missing dependencies and without force uninstall should be checked and disabled' => [ + 'A non installed and non mandatory extension with missing dependencies and without force uninstall should be not checked and disabled' => [ 'aExtensionsOnDiskOrDb' => [ 'itop-ext1' => [ 'installed' => false, @@ -416,12 +416,12 @@ public function ProviderComputeChoiceFlags() 'missing' => false, 'installed' => false, 'disabled' => true, - 'checked' => true, + 'checked' => false, 'dependency_issue' => true, 'mandatory' => false, ], ], - 'An installed extension with missing dependencies and without force uninstall should be checked and disabled' => [ + 'An installed non mandatory extension with missing dependencies and without force uninstall should be not checked and disabled' => [ 'aExtensionsOnDiskOrDb' => [ 'itop-ext1' => [ 'installed' => true, @@ -443,12 +443,12 @@ public function ProviderComputeChoiceFlags() 'missing' => false, 'installed' => true, 'disabled' => true, - 'checked' => true, + 'checked' => false, 'dependency_issue' => true, 'mandatory' => false, ], ], - 'A non installed extension with missing dependencies and force uninstall should be checked and enabled' => [ + 'A non installed and non mandatory extension with missing dependencies and force uninstall should be not checked and enabled' => [ 'aExtensionsOnDiskOrDb' => [ 'itop-ext1' => [ 'installed' => false, @@ -470,12 +470,12 @@ public function ProviderComputeChoiceFlags() 'missing' => false, 'installed' => false, 'disabled' => false, - 'checked' => true, + 'checked' => false, 'dependency_issue' => true, 'mandatory' => false, ], ], - 'An installed extension with missing dependencies and force uninstall should be checked and enabled' => [ + 'An installed non mandatory extension with missing dependencies and force uninstall should be not checked and enabled' => [ 'aExtensionsOnDiskOrDb' => [ 'itop-ext1' => [ 'installed' => true, @@ -497,11 +497,65 @@ public function ProviderComputeChoiceFlags() 'missing' => false, 'installed' => true, 'disabled' => false, - 'checked' => true, + 'checked' => false, 'dependency_issue' => true, 'mandatory' => false, ], ], + 'An installed mandatory extension with missing dependencies and without force uninstall should be checked and disabled' => [ + 'aExtensionsOnDiskOrDb' => [ + 'itop-ext1' => [ + 'installed' => true, + 'missing_dependencies' => [ + 'itop-ext1-1', + ], + ], + ], + 'aWizardStepDefinition' => [ + 'extension_code' => 'itop-ext1', + 'mandatory' => true, + 'uninstallable' => true, + 'missing_dependencies' => true, + ], + 'bCurrentSelected' => false, + 'bDisableUninstallChecks' => true, + 'aExpectedFlags' => [ + 'uninstallable' => true, + 'missing' => false, + 'installed' => true, + 'disabled' => true, + 'checked' => true, + 'dependency_issue' => true, + 'mandatory' => true, + ], + ], + 'An non installed mandatory extension with missing dependencies and without force uninstall should be checked and disabled' => [ + 'aExtensionsOnDiskOrDb' => [ + 'itop-ext1' => [ + 'installed' => false, + 'missing_dependencies' => [ + 'itop-ext1-1', + ], + ], + ], + 'aWizardStepDefinition' => [ + 'extension_code' => 'itop-ext1', + 'mandatory' => true, + 'uninstallable' => true, + 'missing_dependencies' => true, + ], + 'bCurrentSelected' => false, + 'bDisableUninstallChecks' => true, + 'aExpectedFlags' => [ + 'uninstallable' => true, + 'missing' => false, + 'installed' => false, + 'disabled' => true, + 'checked' => true, + 'dependency_issue' => true, + 'mandatory' => true, + ], + ], ]; }