N°9692 - Uninstall / Disable install when extension has module with missing dependencies#967
Conversation
|
| Filename | Overview |
|---|---|
| setup/extensionsmap.class.inc.php | Changed GetAllExtensionsOptionInfo to include extensions with missing dependencies (pass true to GetAllExtensionsToDisplayInSetup) and added the cannot-be-installed key using the already-initialised aMissingDependencies array — safe. |
| setup/wizardsteps/WizStepModulesChoice.php | Core wizard logic updated to disable/uncheck extensions with missing dependencies, block forward movement for mandatory extensions that cannot be installed, and display a badge for non-installed affected extensions; the badge is suppressed for already-installed extensions with missing deps, which may leave admins without a clear explanation during upgrades. |
| tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php | Updated all existing test expectations with the two new flags (cannot-be-installed, mandatory) and adds two new test cases for non-installed and installed extensions that have missing dependencies — coverage looks appropriate. |
| tests/php-unit-tests/unitary-tests/setup/iTopExtensionsMapFake.php | Test stub updated to populate aMissingDependencies from test data; straightforward and correct. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[GetAllExtensionsOptionInfo] -->|bKeepExtensionsHavingMissingDependencies=true| B[GetAllExtensionsToDisplayInSetup]
B --> C{aMissingDependencies > 0?}
C -->|No| D[cannot-be-installed: false]
C -->|Yes| E[cannot-be-installed: true]
D --> F[ComputeChoiceFlags]
E --> F
F --> G{bMissingFromDisk?}
G -->|Yes| H[disabled=true, checked=false]
G -->|No| I{bCannotBeInstalled?}
I -->|Yes| J[disabled=true, checked=false]
I -->|No| K{bMandatory?}
K -->|Yes| L[disabled=true, checked=true]
K -->|No| M[normal flow]
J --> P[bCanMoveForward check]
P --> Q{mandatory OR not-uninstallable?}
Q -->|Yes| R[bCanMoveForward = false]
Q -->|No| S[proceed]
J --> T[badge logic]
T --> U{cannot-be-installed AND !installed?}
U -->|Yes| V[orange badge shown]
U -->|No| W[no dependency badge]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[GetAllExtensionsOptionInfo] -->|bKeepExtensionsHavingMissingDependencies=true| B[GetAllExtensionsToDisplayInSetup]
B --> C{aMissingDependencies > 0?}
C -->|No| D[cannot-be-installed: false]
C -->|Yes| E[cannot-be-installed: true]
D --> F[ComputeChoiceFlags]
E --> F
F --> G{bMissingFromDisk?}
G -->|Yes| H[disabled=true, checked=false]
G -->|No| I{bCannotBeInstalled?}
I -->|Yes| J[disabled=true, checked=false]
I -->|No| K{bMandatory?}
K -->|Yes| L[disabled=true, checked=true]
K -->|No| M[normal flow]
J --> P[bCanMoveForward check]
P --> Q{mandatory OR not-uninstallable?}
Q -->|Yes| R[bCanMoveForward = false]
Q -->|No| S[proceed]
J --> T[badge logic]
T --> U{cannot-be-installed AND !installed?}
U -->|Yes| V[orange badge shown]
U -->|No| W[no dependency badge]
Reviews (4): Last reviewed commit: "N°9692 - Uninstall / Disable install whe..." | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
This PR (issue N°9692) changes the iTop setup wizard so that an extension containing a module with unmet dependencies is no longer silently hidden, but is instead displayed as disabled with a new "cannot be installed" badge and excluded from mandatory auto-selection. Previously such extensions were filtered out of the setup screen entirely; now they are shown so the user understands why they can't be selected, and the "Next" button is blocked only when a mandatory (or non-uninstallable) extension is in a blocking state.
Changes:
ExtensionsMap::GetAllExtensionsOptionInfo()now keeps extensions with missing dependencies and exposes acannot-be-installedflag per extension.ComputeChoiceFlags()computes acannot-be-installedstate (disabled + unchecked) and now returnscannot-be-installedandmandatoryflags, consumed for auto-selection, the "Next" gating logic, and a new tooltip badge.- Removed the "Non-uninstallable extension missing" Next-button label in favor of the badge-based messaging.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| setup/extensionsmap.class.inc.php | Includes extensions with missing dependencies in the setup option list and adds the cannot-be-installed flag. |
| setup/wizardsteps/WizStepModulesChoice.php | Computes/propagates cannot-be-installed and mandatory flags, disables such choices, adds a badge, and adjusts Next-button gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…issing dependencies
b94a9de to
d49a6a7
Compare
…issing dependencies
…issing dependencies
…le-has-missing-depencies
…n-when-module-has-missing-depencies
N°9692 - Uninstall / Disable install when extension has module with missing dependencies