-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
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
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
- Create a simplified ticket template.
- Set a predefined value for the Group requester field.
- Set the Group observer field as hidden.
- Create a ticket using the ticket template.
- Check the ticket and notice that the group is missing.
Your GLPI setup information
GLPI 10.0.19
Anything else?
No response