Skip to content

N°9776 - Fix compatibility with iTop 3.3#9

Open
bdalsass wants to merge 1 commit into
masterfrom
feature/9776-fiw-survey-wizard
Open

N°9776 - Fix compatibility with iTop 3.3#9
bdalsass wants to merge 1 commit into
masterfrom
feature/9776-fiw-survey-wizard

Conversation

@bdalsass

Copy link
Copy Markdown

Base information

Question Answer
Related to a SourceForge thread / Another PR / Combodo ticket? https://support.combodo.com/pages/UI.php?operation=details&class=Bug&id=9776
Type of change? Bug fix

Symptom (bug) / Objective (enhancement)

Broken wizard

Reproduction procedure (bug)

Create a survey with a quizz and test the survey

Cause (bug)

Setup wizard refactored in 3.3

Proposed solution (bug and enhancement)

Keep the old setup wizard in module files to keep compatibility whith 3.2/3.3

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance
  • Would a unit test be relevant and have I added it?
  • Is the PR clear and detailed enough so anyone can understand without digging in the code?

Copilot AI review requested due to automatic review settings July 22, 2026 07:03
@bdalsass bdalsass self-assigned this Jul 22, 2026
@bdalsass bdalsass added the bug Something isn't working label Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a legacy wizard implementation to preserve survey compatibility with iTop 3.2 and 3.3.

Changes:

  • Replaces the iTop wizard dependency with a bundled legacy controller.
  • Adds legacy wizard controller and step implementations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
quizzwizard.class.inc.php Loads the bundled legacy controller.
legacywizardcontroller.class.inc.php Provides the pre-3.3 wizard behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$sCurrentStepClass = utils::ReadParam('_class', $this->sInitialStepClass);
$sCurrentState = utils::ReadParam('_state', $this->sInitialState);
/** @var \WizardStep $oStep */
$oStep = new $sCurrentStepClass($this, $sCurrentState);

$sOperation = utils::ReadParam('operation');
$this->aParameters = utils::ReadParam('_params', [], false, 'raw_data');
$this->aSteps = json_decode(utils::ReadParam('_steps', '[]', false, 'raw_data'), true /* bAssoc */);
Comment thread quizzwizard.class.inc.php
require_once(APPROOT.'setup/wizardcontroller.class.inc.php');
/**
* Old wizard controller version as the wizard controller significantly changed with 3.3 iTop version.
* This module cannot follow changes brings with the 3.3 setup refactoring to be 3.2 compatible.
* internal 'state' for developing complex wizards.
* The WizardController provides the "<< Back" feature by storing a stack
* of the previous screens. The WizardController also maintains from page
* to page a list of "parameters" to be dispayed/edited by each of the steps.
protected $aParameters;

/**
* Initiailization of the wizard controller
* Stores the value of the page's parameter in a "persistent" parameter in the wizard's context
* @param string $sParamCode The code identifying this parameter
* @param mixed $defaultValue The default value for the parameter
* @param string $sSanitizationFilter A 'sanitization' fitler. Default is 'raw_data', which means no filtering
Comment on lines +275 to +276
* Make the wizard run: Start, Next or Back depending WizardUpdateButtons();
on the page's parameters

/**
* Tells whether the parameters are Ok to move forward
* @return boolean True to move forward, false to stey on the same step
@Molkobain
Molkobain requested review from Lenaick, Timmy38 and dflaven July 23, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants