Skip to content

Mandatory fields are validated even when the container is hidden by conditions #1270

Description

@hakimmessas

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.8

Plugin version

1.24.4

Bug description

Hi,

I think I may have found an issue with mandatory fields and container visibility conditions.

Environment:

  • GLPI: 11.0.8
  • Fields plugin: 1.24.4

Configuration:

  • A Fields container is attached to Tickets.
  • The container is displayed only when:
    • Ticket type = Request
    • Category = Visitor Access
  • Several fields inside the container are marked as "Required".

Observed behavior:

  1. Create a new ticket.
  2. Select a ticket type or category that does not match the display conditions.
  3. The container is correctly hidden.
  4. Save the ticket.
  5. The ticket cannot be saved because the required fields inside the hidden container are considered empty.

Expected behavior:
When a container is hidden by its conditions, required fields inside that container should not be validated.
Alternatively, mandatory validation should only apply when the container is visible.

Additional information:

  • If I remove the "Required" flag from the fields, the ticket is saved correctly.
  • The issue is reproducible with a single required field in the container.

Could you please confirm whether this is expected behavior, a limitation, or a bug?

Thank you.

Relevant log output

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

Activity

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

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