Skip to content

Conversation

@RomainLvr
Copy link
Contributor

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 !37010
  • Here is a brief description of what this PR does

If a required multiple dropdown field is present in our ticket form, it is currently possible to create a ticket without selecting any values.

The issue comes from the validation function, which only checks if a required field is empty but does not properly handle multiple-selection fields. For a standard dropdown, the function considers a value of 0 as empty. However, for a multiple dropdown, an unselected field results in an empty array, which is not detected as invalid.

A specific condition must be added to check if a required multiple-selection field is empty by detecting empty arrays during validation.

Screenshots (if appropriate):

image

@RomainLvr RomainLvr requested review from Rom1-B and stonebuzz March 26, 2025 13:43
@RomainLvr RomainLvr self-assigned this Mar 26, 2025
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
@RomainLvr RomainLvr requested a review from Rom1-B March 26, 2025 14:31
@Rom1-B Rom1-B merged commit 694b643 into pluginsGLPI:main Mar 27, 2025
3 checks passed
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.

3 participants