glpi icon indicating copy to clipboard operation
glpi copied to clipboard

Predefined and hidden field values are not saved on ticket when using a template

Open Gabilach opened this issue 5 months ago • 1 comments

Code of Conduct

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

Is there an existing issue for this?

  • [x] I have searched the existing issues

Version

Start from 10.0.19

Bug description

Hello,

For years, I have been using a simplified ticket template with the Group requester field predefined and hidden. This allows certain fields to have predefined values that end users cannot see or modify (in my case, to set a specific group as requester).

Since GLPI 10.0.19, if a field is hidden and has a predefined value, it is not saved when creating a ticket.

Expected behavior: The hidden field value should be saved on ticket creation, as it was in versions prior to 10.0.19.

Technical details: Before 10.0.19, in src/Ticket.php, showFormHelpdesk() directly inserted default values into $default_values, which did not include _groups_id_requester. Predefined hidden fields were therefore added to $options['_hidden_fields'] and saved correctly.

Since 10.0.19, $default_values is retrieved via self::getDefaultValues(), and _groups_id_requester now has a default value (0). This prevents setPredefinedFields() from adding it to hidden_fields, so the value is not saved on ticket creation.

Steps To reproduce

  1. Create a simplified ticket template.
  2. Set a predefined value for the Group requester field.
  3. Set the Group observer field as hidden.
  4. Create a ticket using the ticket template.
  5. Check the ticket and notice that the group is missing.

Your GLPI setup information

GLPI 10.0.19

Anything else?

No response

Gabilach avatar Sep 24 '25 11:09 Gabilach

Hello do you have more details of the issues ? A video or screenshots would be very useful.

I tried reproducing the issue in GLPI 11-dev and I the group was well defined as per the predefined value. I did like your step 3 specified hiding the Observer group even if it won't have an impact in the simplified interface as it use Forms

froozeify avatar Dec 09 '25 14:12 froozeify