Skip to content

fix(dropdown): handle empty default value to prevent error#1128

Open
MyvTsv wants to merge 3 commits intopluginsGLPI:mainfrom
MyvTsv:ticket41833
Open

fix(dropdown): handle empty default value to prevent error#1128
MyvTsv wants to merge 3 commits intopluginsGLPI:mainfrom
MyvTsv:ticket41833

Conversation

@MyvTsv
Copy link
Contributor

@MyvTsv MyvTsv commented Feb 5, 2026

  • 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 !41833
  • When creating a multiple-choice field without a default value, the default value is correctly stored in the database as an empty array.

However, when adding a new item, the field value is transmitted as an empty string, resulting in an inconsistent value being stored for the created object.

This inconsistency then causes an error when displaying the form, as the stored value does not match the expected type for a multiple-choice field.

This pull request corrects this behavior to ensure the consistency of the stored data type and avoid the form display error.

image

@MyvTsv MyvTsv self-assigned this Feb 5, 2026
@MyvTsv MyvTsv requested review from Rom1-B and stonebuzz and removed request for stonebuzz February 5, 2026 13:25
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