N°9753 - Extension management - Run setup display installation and not upgrade#962
Conversation
|
| Filename | Overview |
|---|---|
| setup/wizardsteps/WizStepSummary.php | Core bug fix: GetNextButtonLabel() now reads the 'mode' parameter to return 'Install' vs 'Upgrade' instead of always returning 'Install'; minor control-flow refactor in GetTitle() is functionally equivalent. |
| setup/wizardsteps/WizardStep.php | Production WizardStep base class updated correctly; the commented-out example code still references name="install_mode" in HTML form inputs while ProcessParams now reads 'mode', leaving the example internally inconsistent. |
| setup/wizardsteps/WizStepWelcome.php | Consistently renames GetParameter/SetParameter calls from 'install_mode' to 'mode' in both UpdateWizardStateAndGetNextStep and the previous-instance detection block. |
| setup/wizardsteps/WizStepLandingBeforeAudit.php | Single SetParameter call renamed from 'install_mode' to 'mode' for upgrade detection. |
| setup/wizardsteps/WizStepLicense.php | Parameter key renamed; unused 'use WebPage' import also removed cleanly. |
| setup/wizardsteps/WizStepModulesChoice.php | Single GetParameter call renamed from 'install_mode' to 'mode' to set the bUpgrade flag. |
| setup/wizardsteps/AbstractWizStepInstall.php | GetParameter renamed from 'install_mode' to 'mode' in BuildConfig(); no other changes. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant W as WizStepWelcome
participant L as WizStepLicense
participant M as WizStepModulesChoice
participant S as WizStepSummary
participant A as AbstractWizStepInstall
W->>W: DetectPreviousInstance()
alt Previous instance found
W->>W: SetParameter('mode', 'upgrade')
else Fresh install
W->>W: SetParameter('mode', 'install')
end
W->>L: navigate
L->>L: GetParameter('mode') → NeedsGdprConsent?
L->>M: navigate
M->>M: "GetParameter('mode') != 'install' → bUpgrade"
M->>S: navigate
S->>S: GetParameter('mode') → GetTitle()
S->>S: GetParameter('mode') → GetNextButtonLabel() — 'Install' OR 'Upgrade'
S->>A: BuildConfig()
A->>A: GetParameter('mode', 'install')
%%{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"}}}%%
sequenceDiagram
participant W as WizStepWelcome
participant L as WizStepLicense
participant M as WizStepModulesChoice
participant S as WizStepSummary
participant A as AbstractWizStepInstall
W->>W: DetectPreviousInstance()
alt Previous instance found
W->>W: SetParameter('mode', 'upgrade')
else Fresh install
W->>W: SetParameter('mode', 'install')
end
W->>L: navigate
L->>L: GetParameter('mode') → NeedsGdprConsent?
L->>M: navigate
M->>M: "GetParameter('mode') != 'install' → bUpgrade"
M->>S: navigate
S->>S: GetParameter('mode') → GetTitle()
S->>S: GetParameter('mode') → GetNextButtonLabel() — 'Install' OR 'Upgrade'
S->>A: BuildConfig()
A->>A: GetParameter('mode', 'install')
Comments Outside Diff (1)
-
setup/wizardsteps/WizardStep.php, line 249-251 (link)Example code inconsistency after parameter rename
The block comment from line 204 to 378 is a documented usage example.
ProcessParams()was updated to readutils::ReadParam('mode')(line 229), but the radio inputs inDisplay()still emitname="install_mode". If anyone were to activate this example, the submitted form value would not be captured. The example documentation should stay in sync with the renamed parameter.
Reviews (1): Last reviewed commit: ":construction: Refactor installation mod..." | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
This PR renames the setup wizard parameter install_mode to mode across the installation wizard steps. The wizard was setting/reading install_mode, while the rest of the setup machinery (install params in AbstractWizStepInstall, parameters.class.inc.php, and the sequencers) already used mode. That split naming caused a fresh install to be presented as an "upgrade". Unifying on mode makes the summary title, next-button label, license/GDPR logic, and module-choice logic reflect the correct install-vs-upgrade state.
Changes:
- Renamed the wizard parameter
install_mode→modein all wizard steps that read or write it. - Refactored
WizStepSummaryso both the step title and the "Next" button label branch onmode(showing "Install"/"Ready to install" vs "Upgrade"/"Ready to upgrade"). - Removed the now-unused
WebPageimport inWizStepLicense.php.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| setup/wizardsteps/WizStepWelcome.php | Reads/sets the mode under the new mode key when detecting a previous instance. |
| setup/wizardsteps/WizStepSummary.php | Title and Next-button label now branch on mode to show install vs upgrade. |
| setup/wizardsteps/WizStepModulesChoice.php | bUpgrade flag derived from the mode parameter. |
| setup/wizardsteps/WizStepLicense.php | GDPR-consent check reads mode; removes unused WebPage import. |
| setup/wizardsteps/WizStepLandingBeforeAudit.php | Sets mode to upgrade for the pre-audit landing flow. |
| setup/wizardsteps/WizardStep.php | Updates the (commented) example step to use mode; radio input names left as install_mode (nit). |
| setup/wizardsteps/AbstractWizStepInstall.php | Reads mode from the wizard when building the install config. |
Comments suppressed due to low confidence (1)
setup/wizardsteps/WizardStep.php:251
- In this example step,
ProcessParams()was updated to read the mode viautils::ReadParam('mode')(line 229), but the radio inputs here still postname="install_mode". This makes the illustrative example internally inconsistent: the submitted field (install_mode) no longer matches the parameter that is read (mode), so the example would always fall through to the "upgrade" branch if used. Consider renaming these input fields tomodeto match.
$oPage->p('<input type="radio" name="install_mode" value="install"'.$sChecked.'/> Install');
$sChecked = ($sInstallMode == 'upgrade') ? ' checked ' : '';
$oPage->p('<input type="radio" name="install_mode" value="upgrade"'.$sChecked.'/> Upgrade');
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
N°9753 - Extension management - Run setup display installation and not upgrade