N°9876 - A non installed extension should not be selected - #992
Conversation
|
| Filename | Overview |
|---|---|
| setup/extensionsmap.class.inc.php | Removes the mutation that previously made remote extensions mandatory while building the setup extension map. |
| setup/wizardsteps/WizStepModulesChoice.php | Refactors checked and disabled flag computation for missing, mandatory, protected, dependency-broken, and nested extension choices. |
| tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php | Expands table-driven coverage for the refactored choice-state decision tree and updates rendering expectations. |
| tests/php-unit-tests/unitary-tests/setup/ressources/compute_choice_flags.flowchart.fun | Documents the intended extension-choice state transitions represented by the updated tests. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Extension choice] --> B{Missing from disk?}
B -->|Yes| C[Unchecked and disabled]
B -->|No| D{Mandatory packaged extension?}
D -->|Yes| E[Checked and disabled]
D -->|No| F{Checked protected sub-option?}
F -->|Yes| G[Force parent checked]
F -->|No| H{Dependency issue?}
H -->|Yes| I{Installed and force uninstall enabled?}
I -->|No| J[Disabled]
I -->|Yes| K[Preserve selected state]
H -->|No| L{Installed remote or non-uninstallable?}
L -->|Yes| M[Disable unless force uninstall]
L -->|No| K
Reviews (5): Last reviewed commit: "N°9876 - Undo remove ComputeChoiceFlags ..." | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
Prevents optional, non-installed extensions from being selected automatically during setup.
Changes:
- Preserves extension-defined mandatory status.
- Refines force-uninstall selection behavior.
- Updates related flag tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
setup/extensionsmap.class.inc.php |
Stops forcing remote extensions to mandatory. |
setup/wizardsteps/WizStepModulesChoice.php |
Adjusts checked and disabled flags. |
tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php |
Updates and expands flag scenarios. |
Suppressed comments (1)
tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php:661
- This scenario does not exercise the newly changed installed/non-uninstallable branch:
installedis false whilemandatoryanduninstallableare true, so execution takes the mandatory branch instead. Configure an installed, optional, non-uninstallable extension so the test verifies that force-uninstall leaves it enabled but checked even when it was not selected.
'An installed extension with force uninstall should be checked and enabled' => [
'aExtensionsOnDiskOrDb' => [
'itop-ext1' => [
'installed' => false,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Installed extension with dependency issue must be checked and disabled without force-uninstall * Mandatory extension with force-uninstall must be checked * Mandatory or installed extension must keep unchecked status when move to another step
f0ff7ec to
1cf0680
Compare
…ld-not-be-selected-if-it-is-not-mandatory ^ Conflicts: ^ setup/wizardsteps/WizStepModulesChoice.php ^ tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php
odain-cbd
left a comment
There was a problem hiding this comment.
great test coverage/documentation on this setup part. it looks good to me.
quite difficult to keep all desired behaviours and make it simple.... unfortunately
N°9876 - A non installed extension should not be selected if it is not mandatory