Skip to content

Mandatory Yes/No field does not respect default value "No" in ticket form #1082

@OteJlo

Description

@OteJlo

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

11.0.2

Plugin version

1.23.0

Bug description

When adding a Yes/No field as mandatory in a ticket form, the default value is set to No. However, if the user leaves the field as No, the form validation fails, and the ticket cannot be submitted. The mandatory check only works when the value is changed to Yes.
This means the mandatory field logic does not work correctly for Yes/No fields, as the default value "No" should be considered valid when the field is required.

Steps To reproduce

  1. Go to Fields plugin configuration.
  2. Add a new field of type Yes/No.
  3. Set the field as mandatory.
  4. Assign it to a ticket form.
  5. Create a new ticket and leave the field as No (default value).
  6. Try to submit the ticket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions