N°9776 - Fix compatibility with iTop 3.3#9
Open
bdalsass wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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 */); |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base information
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