Skip to content

N°9753 - Extension management - Run setup display installation and not upgrade#962

Merged
eespie merged 2 commits into
developfrom
feature/Extension_management_is_upgrade_mode_only
Jul 7, 2026
Merged

N°9753 - Extension management - Run setup display installation and not upgrade#962
eespie merged 2 commits into
developfrom
feature/Extension_management_is_upgrade_mode_only

Conversation

@eespie

@eespie eespie commented Jul 7, 2026

Copy link
Copy Markdown
Member

N°9753 - Extension management - Run setup display installation and not upgrade

Copilot AI review requested due to automatic review settings July 7, 2026 09:17
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Jul 7, 2026
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug where the setup wizard's summary step always displayed "Install" as the next-button label even when running in upgrade mode. It also renames the internal wizard parameter key from install_mode to mode across all relevant wizard step classes.

  • Core fix (WizStepSummary): GetNextButtonLabel() now reads the mode parameter and returns 'Upgrade' when appropriate, instead of unconditionally returning 'Install'.
  • Parameter rename: Every GetParameter/SetParameter call using 'install_mode' in WizStepWelcome, WizStepLandingBeforeAudit, WizStepLicense, WizStepModulesChoice, and AbstractWizStepInstall is updated to 'mode'.
  • Cleanup: An unused use Combodo\iTop\Application\WebPage\WebPage import is removed from WizStepLicense.php.

Confidence Score: 4/5

Safe to merge; the parameter rename is applied consistently across all production wizard step classes and the button-label fix is straightforward.

All production reads and writes of the wizard parameter are consistently updated from install_mode to mode. The only residual reference to install_mode lives inside a block-commented example section in WizardStep.php, which is never executed but is now internally inconsistent documentation.

The commented-out example code in setup/wizardsteps/WizardStep.php (lines 249–251) still uses name="install_mode" in HTML form inputs while ProcessParams now reads mode; worth keeping the example in sync.

Important Files Changed

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')
Loading
%%{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')
Loading

Comments Outside Diff (1)

  1. setup/wizardsteps/WizardStep.php, line 249-251 (link)

    P2 Example code inconsistency after parameter rename

    The block comment from line 204 to 378 is a documented usage example. ProcessParams() was updated to read utils::ReadParam('mode') (line 229), but the radio inputs in Display() still emit name="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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_modemode in all wizard steps that read or write it.
  • Refactored WizStepSummary so both the step title and the "Next" button label branch on mode (showing "Install"/"Ready to install" vs "Upgrade"/"Ready to upgrade").
  • Removed the now-unused WebPage import in WizStepLicense.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 via utils::ReadParam('mode') (line 229), but the radio inputs here still post name="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 to mode to 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.

@eespie eespie merged commit c371431 into develop Jul 7, 2026
@eespie eespie deleted the feature/Extension_management_is_upgrade_mode_only branch July 7, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants