Skip to content

[main] Fix form submission error when a multiple dropdown field question is empty - #1341

Draft
glpi-project[bot] wants to merge 1 commit into
mainfrom
forward-port/1323-to-main
Draft

glpi-project[bot] wants to merge 1 commit into
mainfrom
forward-port/1323-to-main

Conversation

@glpi-project

@glpi-project glpi-project Bot commented Nov 9, 2026

Copy link
Copy Markdown

Forward-port of #1323 to main.

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !47292
  • Here is a brief description of what this PR does

Submitting a form with an empty multiple dropdown field question failed with a TypeError. An empty selection sends items_id = '', and formatRawAnswer() passed that value to getById() without casting it to an integer. The ids are now cast to integers and empty values are filtered out.

Screenshots (if appropriate):

@glpi-project

glpi-project Bot commented Nov 9, 2026

Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin forward-port/1323-to-main
git worktree add --checkout .worktree/forward-port/1323-to-main forward-port/1323-to-main
cd .worktree/forward-port/1323-to-main
git reset --hard HEAD^
git cherry-pick -x be73dd95407fecfd7ec13fb7d0217473a03bf91c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant