Skip to content

FIX / Mandatory fields blocking ticket creation from a GLPI form - #1294

Open
Mary-Clb wants to merge 2 commits into
11.0/bugfixesfrom
fix/mandatory-fields-block-form-destination
Open

Mary-Clb wants to merge 2 commits into
11.0/bugfixesfrom
fix/mandatory-fields-block-form-destination

Conversation

@Mary-Clb

@Mary-Clb Mary-Clb commented Oct 8, 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 !46413
  • A GLPI form cannot create a ticket when a mandatory additional field is not part of the form: the creation fails with "Some mandatory fields are empty". The field is expected to stay out of the form while remaining mandatory on the ticket itself.

This is a follow-up to #1275 (merged), which only clarified the error message and did not remove the blocking.

Items created by a form destination are now exempted from the mandatory check, like the other automated creations handled in #1274. The exemption also covers the update done right after the creation to link the item to the form. On the ticket form, a mandatory dropdown that was never filled is now rendered with its empty option, so saving shows the mandatory error instead of doing nothing.

Screenshots:

Capture d’écran du 2026-10-08 11-08-49 Capture d’écran du 2026-10-08 11-09-01 Capture d’écran du 2026-10-08 11-09-10

@Mary-Clb Mary-Clb self-assigned this Oct 8, 2026
@Mary-Clb
Mary-Clb marked this pull request as ready for review October 8, 2026 12:02
Comment thread inc/container.class.php Outdated
Comment thread templates/fields.html.twig Outdated
@Mary-Clb

Mary-Clb commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Some points following my commit :

  • The exemption now only covers mandatory fields the form does not provide; a mapped field left empty blocks the creation again.
  • dropdown-* fields use dropdown_value as suggested.
  • The input token is replaced by a static state in PluginFieldsDestinationField, holding the fields provided by the form.
  • That state is cleared once the destination is done, so later updates of the ticket are validated as usual.
  • Tests added for the mapped field left empty, the update after the destination, and the empty option on mandatory dropdowns.

@Mary-Clb
Mary-Clb requested a review from Rom1-B October 9, 2026 13:00
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.

2 participants