Skip to content

FIX / Default value migrated from Formcreator wrongly checks first option when unmatched - #25564

Merged
cedric-anne merged 3 commits into
glpi-project:11.0/bugfixesfrom
Mary-Clb:fix/selectable-question-default-value-mismatch
Sep 22, 2026
Merged

cedric-anne merged 3 commits into
glpi-project:11.0/bugfixesfrom
Mary-Clb:fix/selectable-question-default-value-mismatch

Conversation

@Mary-Clb

Copy link
Copy Markdown
Contributor
  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • It fixes !44202
  • array_search() returning false for a stale/renamed default value was coerced to index 1 via false + 1, silently checking the first checkbox/radio option instead of leaving nothing selected.

Screenshots :

@Mary-Clb
Mary-Clb marked this pull request as ready for review September 18, 2026 09:09
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Powered by Qodo

@Mary-Clb Mary-Clb self-assigned this Sep 18, 2026
@Mary-Clb
Mary-Clb marked this pull request as draft September 18, 2026 13:24
@Mary-Clb
Mary-Clb marked this pull request as ready for review September 18, 2026 13:24
@Mary-Clb
Mary-Clb requested review from Rom1-B and ccailly September 18, 2026 13:25

@ccailly ccailly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The options can be read directly from convertExtraData to maintain the same indexing and sorting logic. The method already removes empty values.

Comment thread src/Glpi/Form/QuestionType/AbstractQuestionTypeSelectable.php Outdated
Comment thread src/Glpi/Form/QuestionType/AbstractQuestionTypeSelectable.php Outdated
@Mary-Clb
Mary-Clb requested a review from ccailly September 21, 2026 14:20
@cedric-anne cedric-anne added this to the 11.0.10 milestone Sep 22, 2026
@cedric-anne
cedric-anne merged commit 4ab672f into glpi-project:11.0/bugfixes Sep 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants