Skip to content

fix(container): hidden block mandatory fields blocking item save - #1292

Open
MyvTsv wants to merge 1 commit into
pluginsGLPI:11.0/bugfixesfrom
MyvTsv:ticket46553
Open

MyvTsv wants to merge 1 commit into
pluginsGLPI:11.0/bugfixesfrom
MyvTsv:ticket46553

Conversation

@MyvTsv

@MyvTsv MyvTsv commented Oct 7, 2026

Copy link
Copy Markdown
Contributor
  • 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 !46553
  • Here is a brief description of what this PR does

Root cause

When a block submits no values (e.g. a block not rendered in the form), checkContainerMandatory() still validates its mandatory fields against the persisted values. It does not take the block's display conditions into account: a block hidden by a condition is never rendered, so its mandatory fields can't be filled, and the item save fails with "Some mandatory fields are empty".

Steps to reproduce

  1. Create a "Insertion in the form" (dom) block for Tickets with a mandatory field.
  2. Add a display condition to the block: hide it when Type = Incident.
  3. Create a new ticket with type Incident: the block is not displayed.
  4. Save the ticket: the error "Some mandatory fields are empty" appears and the ticket is not created.

Screenshots (if appropriate):

@MyvTsv MyvTsv self-assigned this Oct 7, 2026
@MyvTsv
MyvTsv marked this pull request as ready for review October 7, 2026 12:00

@Rom1-B Rom1-B left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create the same PR for main

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